0

I saw this post:

How do I get applescript to work with Preview in Snow Leopard?

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.

Jared
  • 1

2 Answers2

2

In Mac OS Lion the Info.plist owns you:

sudo defaults write /Applications/Preview.app/Contents/Info NSAppleScriptEnabled -bool true
sudo chmod 644 /Applications/Preview.app/Contents/Info.plist
sudo codesign -f -s - /Applications/Preview.app

Now this shouldn't cause an error:

tell app "Preview" to windows

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

Lri
  • 42,502
  • 8
  • 126
  • 159
1

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

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

So I guess I had answered that question. :)

ghoppe
  • 6,558
  • 25
  • 21