So I've got the following:

set mypath to /Users/myuser/Desktop/file.pdf

I want to copy the file of this path to my clipboard. How to I do this? I tried:

set the clipboard to the file mypath

This does not work. Any idea? I just want to be able to copy this file to any application using the clipboard.

There are several clipboards, so even if your file managed to fit in the clipboard, all applications is so broad that it's certain many or most will not grab the file contents as you expect/intend and instead grab a name of the file or pe haps the path.

The receiving application decides what to pull off the clipboard and not the script that places something in the clipboard.

You'll likely need to write specific scripts for specific apps and potentially re-evaluate AppleScrips since it might not be the correct tool for this job.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.