• 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 the unscriptable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting the unscriptable


  • Subject: Re: Scripting the unscriptable
  • From: Elliott Roper <email@hidden>
  • Date: Tue, 26 Jan 2010 23:10:55 +0000

Just to wrap this up, by way of thanks for the assistance I got, and to help any other newbies getting started on GUI scripting as they search the archives, here is the finished job:-

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 {-1680, 0}
set size of window 1 to {1680, 1050}
end if
end tell
end tell
end if

I saved it as an application with the name rs preview resizer.app

So now, when I open a document in Preview, I can stretch it to cover my second screen by typing "rs" in Spotlight. Y'know cmd-space r s ret .. and I don't have to look under all the paper on my desk for the goddamn mouse.
..and Preview remains in focus. It works kinda nice.

It is pretty obvious what to change if your second monitor is on the right, or a different size.

It might be fun to extend it a bit to sniff out the hardware and think up a sensible spot to place the stretched window.

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

References: 
 >Scripting the unscriptable (From: Elliott Roper <email@hidden>)
 >Re: Scripting the unscriptable (From: Robert Poland <email@hidden>)
 >Re: Scripting the unscriptable (From: Elliott Roper <email@hidden>)

  • Prev by Date: Re: Scripting the unscriptable
  • Next by Date: Re: Send outgoing message error from Mail.app
  • Previous by thread: Re: Scripting the unscriptable
  • Next by thread: Re: Scripting the unscriptable
  • Index(es):
    • Date
    • Thread