Is OSX Lion (or older OSX) release of Preview scriptable?
AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system automation tools.
Command + period (.) You can also kill (force quit) Script Editor and, provided it autosaves your documents, the scripts will be restored to the last compiled versions when you reopen.
Preview is not now, and have never been AppleScript-able, which does suck. It'd be nice if it were, though.
From this blog:
However, from 10.4–10.6 it was possible to enable the default Cocoa scripting support via these Terminal commands:
sudo defaults write /Applications/Preview.app/Contents/Info
NSAppleScriptEnabled -bool YES
sudo chmod a+r /Applications/Preview.app/Contents/Info.plist
This was sufficient to be able to get at the file of the current document to delete it, change its Finder label, import it into EagleFiler, etc. Under 10.7, modifying the Info.plist file breaks the application’s code signature. I would expect this to cause a harmless warning message in the Console, but it actually causes Preview to crash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With