Re: Scripting Preview
Re: Scripting Preview
- Subject: Re: Scripting Preview
- From: Robert Poland <email@hidden>
- Date: Sun, 14 Oct 2012 15:12:21 -0600
Thanks Elliot,
set zoom of window 1 to (100) didn't seem to do anything but keystroke "9" using command down did the trick.
On Oct 14, 2012, at 3:00 PM, Elliott Roper < email@hidden> wrote: On 14 Oct 2012, at 19:56, Robert Poland <email@hidden> wrote:
Hi,
I would like to, somehow, get the window in Preview to open in other than the stupid default little one.
Sent from my iPad
As Yvan Koenig has said, Preview is not scriptable. But you can get most of the way there by GUI scripting. Here's an old one of mine to resize a preview window to fill the screen on a MacBook Air
if application "Preview" is running then tell application "System Events" tell application process "Preview" if window 1 exists then set position of window 1 to {0, 44} set bounds of window 1 to {0, 44, 1363, 764} set zoom of window 1 to (100) end if end tell end tell end if
To make GUI scripting work, you must enable access for assistive devices in accessibility system prefs. My lazy way of deriving the co-ordinates was to record a script while resizing a finder window. I saved the script as an app, then invoked it via spotlight.
I have not used it since I got Lion, because it was easier just to go full screen.
Elliott Roper
Robert Poland 2.7 GHz Intel Core I5, 27” iMac 12 GB Ram, 1TB HD OS X 10.8.2 (12C54)
|
_______________________________________________
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