Re: Is Preview scriptable?
Re: Is Preview scriptable?
- Subject: Re: Is Preview scriptable?
- From: "Gary (Lists)" <email@hidden>
- Date: Sun, 27 Jan 2008 20:23:10 -0500
- Thread-topic: Is Preview scriptable?
"Michelle Steiner" wrote:
> On Jan 27, 2008, at 2:57 PM, Graham Sims wrote:
>
>> I am convinced I had the following script working in Preview to
>> position and set the size of the frontmost window
>
> Preview is not scriptable. To find out whether an application is
> scriptable, drag its icon onto the Script Editor icon; if it is
> scriptable, Script Editor will open its dictionary. Otherwise, Script
> Editor will tell you that it is not scriptable.
You can turn on the Plist property that provides some basic scriptability to
Preview. I do this, so that I can send files opened in Preview over to Skim
PDF reader.
Run this script in Script Editor:
tell application "Finder"
set the Preview_app to (application file id "com.apple.Preview") as alias
duplicate Preview_app
end tell
set the plist_filepath to the quoted form of ¬
((POSIX path of the Preview_app) & "Contents/Info")
do shell script "defaults write " & the plist_filepath & space ¬
& "NSAppleScriptEnabled -bool YES"
This works in Preview in Leopard. Duplicate your copy of Preview first, so
that you have a fallback in case something gets botched.
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden