Super User is a question and answer site for computer enthusiasts and power users. 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

I saw this post:

In my attempt to figure out how to use AppleScript with Preview. I'm trying to automate a series of tasks that will open documents and resize them automatically to the most efficient view in situations where I need to view multiple documents at once. I can't figure out how to add scripting functionality in Preview (meaning simply, I can't get Automator or AppleScript to resize preview windows automatically). I saw this thread but there was no answer. I'm wondering if you've figured anything out since then.

share|improve this question

In Mac OS Lion the Info.plist owns you:

sudo defaults write /Applications/ NSAppleScriptEnabled -bool true
sudo chmod 644 /Applications/
sudo codesign -f -s - /Applications/

Now this shouldn't cause an error:

tell app "Preview" to windows

As in 10.6, Preview still won't have a dictionary.

share|improve this answer

My answer to that post you mention has a link to this thread which shows a terminal command (defaults write /Applications/ NSAppleScriptEnabled -bool YES) that turns on basic scripting for Preview.

One of the links on that thread is to this blog post, which explains in depth how to resize document windows in Preview.

So I guess I had answered that question. :)

share|improve this answer
WARNING: Don't follow ghoppe's suggestion above for the Lion (10.7) version of Preview. Changing anything inside of the application's executable will invalidate the code signing check and cause Preview not to open. Worse, it's really difficult to get the Preview application working again without access to another system running Lion -- you can't just "undo" the property list edit to roll back to a working version! – user92958 Aug 4 '11 at 23:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .