• 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: Preview.app scriptable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preview.app scriptable


  • Subject: Re: Preview.app scriptable
  • From: Robert Poland <email@hidden>
  • Date: Wed, 13 Jan 2010 07:23:12 -0700

Jobst,

Here's a small part of a script I use. Maybe you can adapt it to your use.

set newL to 20
set newT to 22
set wd to 800
set ht to 1000
tell (do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep Resolution") to set {newR, newB} to {word 2 as number, word 4 as number} -- get screen size for monitor

-- tell application "Finder" to set x to the displayed name of (path to frontmost application)
tell application "Finder" to set x to the displayed name of (path to application "Firefox")
if x contains "Firefox" then
set apli to "Firefox"
set rignewBoffset to 190 -- offset to the left for large screen
set newR to newR - (rignewBoffset) -- 1500
set newT to 22
if newR > 1440 then -- larger monitor
set newL to 593 - (rignewBoffset) -- 413
set newSize to newR - newL
else -- MBP
set newL to 280
set newSize to newR - newL
end if
end if
tell application "System Events" to tell application process apli
tell first window
set size to {newSize, newB}
set position to {newL, newT}
--click button 2
end tell
set frontmost to true
end tell
beep
return



On Jan 13, 2010, at 6:03 AM, Gmeiner Jobst wrote:

Hi everybody,

with OSX 10.5.8 I used the following script (which I had found somewhere in the internet)

try
tell application "Finder"
set the Preview_app to (application file id "com.apple.Preview") as alias
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"
end try

in order to make Preview.app scriptable. The reason was that I wanted to get the windows of Preview.app to a defined position on my screen with scripting.

Now, having moved to Snow Leopard, the script above doesn't work anymore, Preview.app is no longer scriptable.

Is there another possibility, either acchieving scripting Preview.app or using another programm which can open .jpg files and is scriptable,
in order to put the pictures to a defined position on the screen?

Thanks for suggestions
Jobst Gmeiner

___________________________________

Jobst Gmeiner
email@hidden



Bob Poland - Fort Collins, CO



 _______________________________________________
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: Preview.app scriptable
      • From: Gmeiner Jobst <email@hidden>
References: 
 >Preview.app scriptable (From: Gmeiner Jobst <email@hidden>)

  • Prev by Date: Preview.app scriptable
  • Next by Date: Re: iCal alarm scripts
  • Previous by thread: Preview.app scriptable
  • Next by thread: Re: Preview.app scriptable
  • Index(es):
    • Date
    • Thread