Ah, lovely. That works. Thank you.
However, I noticed that when I move a file in this manner, Preview.app still shows it as being in the original location and the file is now listed as being “locked”.
Is there a way to move the file and have the new location reflected in Preview.app?
Failing that, I would assume that I need to do the following:
- Close the file in Preview
- Move the file
- Re-Open the file from its new location
Which isn’t very elegant, but might be my only option.
If #2 is the way to do, I thought this might do it
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell document 1 of application "Preview"
set theFile to path
set theFile to POSIX file theFile
tell application "Finder"
move theFile to folder ((path to home folder as string) & "Dropbox:Photos")
set theNewFile to file ((path to home folder as string) & "Dropbox:Photos" & theFile)
set theNewFile to POSIX file theNewFile
tell application "Preview"
but although this does move the file to Dropbox and does close the file in Preview, it does not re-open the file in the new location. If I had to guess, I am probably not setting
theNewFile properly, but I’m not sure how to do is correctly.