• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting Preview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Preview


  • Subject: Re: Scripting Preview
  • From: Elliott Roper <email@hidden>
  • Date: Sun, 14 Oct 2012 22:00:05 +0100

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





 _______________________________________________
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

  • Follow-Ups:
    • Re: Scripting Preview
      • From: Robert Poland <email@hidden>
References: 
 >Scripting Preview (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Scripting Preview
  • Next by Date: Re: Scripting Preview
  • Previous by thread: Re: Scripting Preview
  • Next by thread: Re: Scripting Preview
  • Index(es):
    • Date
    • Thread