Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an Applescript dictionary for I am unable to find it under Mac OS X 10.7.5, and Applescript 2.2.1.

I did a rudimentary search in google and duckduck but came up empty.

I've also ran however when I run it for Preview I am getting the following error:

tell application "Preview"
    get every property
        --> error number -1708
error "Preview got an error: Can’t get every property." number -1728 from every property

Where can I find the scriptable objects for Preview?

I have found several answers saying it is not scriptable, however I have not changed the NSAppleScriptEnabled preference and the following runs:

tell application "Preview"
    set save_location to ¬
        (choose file with prompt "Choose the png to be modified")
    open save_location

end tell

I've posted a separate question about why this runs on stackexchange.

My original question stands. Where/How can I find the scriptable objects?

share|improve this question
It appears that does not have a scripting dictionary and is thus not scriptable. – Daniel Nov 18 '13 at 15:50
Thanks for the edit, have not had first coffee yet. Just because something does not have a defined dictionary it does not mean it is not scriptable. – Deesbek Nov 18 '13 at 15:52
tell application "Preview" set save_location to ¬ (choose file with prompt "Choose the png to be modified") activate open save_location end tell – Deesbek Nov 18 '13 at 15:53
I haven't had any luck scripting Preview. I hope you find someone with a better answer; I'd look forward to reading it. – Daniel Nov 18 '13 at 15:53
That is a rudimentary file open which is working, but as I was trying to answer I was trying to add text, which without a dictionary is just stabbing in the dark. – Deesbek Nov 18 '13 at 15:57
up vote 3 down vote accepted

As markhunte said, NSAppleScriptEnabled is set to true by default in Preview's Info.plist in 10.9. So Preview has a basic AppleScript dictionary, and tell application "Preview" to properties works by default.

In 10.8 or earlier versions of OS X you can set NSAppleScriptEnabled to true manually:

defaults write NSAppleScriptEnabled -bool true

The open and activate commands also work with applications that don't have an AppleScript dictionary.

share|improve this answer is NOT made Scriptable by apple and as far as I am aware never has been.


It does appear apple have enabled scriptability in

And I only say this is the case as I have a new install on a Macbook Pro that I know I have never change the Previews scriptability.

Never the less there is still no suite.

I suspect (and I may have the facts wrong) this was because was original only for previewing files and not an editor.

Although there are now more options to actually edit some file types in Preview apple have NOT made it scriptable.

This is not to say it cannot be made scriptable. AFAIK all cocoa app can be made scriptable if the developer creates a Scripting Definition File for it. To do this you would need to know the methods in the code of the application to define ( putting it simply)

You could even write the sdef file yourself if you know the method information.

You can make scriptable by changing it's NSAppleScriptEnabled preference. But that is pretty much pointless as this would only list some of the standard suits. But would know nothing about it's self.

share|improve this answer
Hi I have not changed NSAppleScriptEnabled preference but a short script I wrote, ran. See the edited question for the code???? – Deesbek Nov 18 '13 at 16:46
updated answer in light of this.. – markhunte Nov 18 '13 at 16:59

I would say that considering Automator contains scripted actions which are based in Applescript there is indeed a way to script Preview, just depends what you're trying to do.

Some perusing in the Automator actions section for Preview may yield good results. There are a number of tools I use such as rotation and scaling operations for batch processing which should be accessible to Applescript. Perhaps also Automator might prove a good method to get around not having direct Applescript access since you can embed Applescript in an Automator workflow.

Good hunting!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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