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
Bob Poland - Fort Collins, CO
Bob Poland - Fort Collins, CO