After some mucking about for a few hours or so it’s driving me crazy and I can’t get any help from googling the idea on the web what can i add to this script to make it work.
I need it to continue the script if ok is pressed and to cancel and restart the process if the later is pressed.
I came up with the idea because i cant find a script that works with my adobe software.
And applescript intrigues me…
repeat
tell application "System Events"
tell application "Adobe Photoshop CS" to activate
delay 600
display dialog "Do you need to save your work Nick"
tell process "Adobe Photoshop CS" to keystroke "s" using command down
end tell
end repeat
¢ the save command in Photoshop is greyed out if no changes are made
¢ you have to trap the error when button “Cancel” is pressed
this script has two try - end try - blocks to avoid those problems.
Save it as a stay open application, the idle handler repeats the code
every 10 minutes
on idle
tell application "System Events"
tell application "Adobe Photoshop CS" to activate
try
display dialog "Do you need to save your work Nick"
try
tell process "Adobe Photoshop CS" to keystroke "s" using command down
end try
end try
end tell
return 600
end idle
to accustom to press cmd-s frequently is another solution for your problem ;)
Model: G5 dual 2,5 GHz
Browser: Safari 419.3
Operating System: Mac OS X (10.4)
Looks like stefan got in before me but here you go anyway.
repeat
tell application "Adobe Photoshop CS"
activate
delay 10
set Button_pressed to display dialog "Do you need to save your work Nick" buttons {"No", "Yes"} default button 2
if button returned of Button_pressed is "No" then
tell application "Adobe Photoshop CS"
activate
delay 10
end tell
else
tell application "System Events"
tell process "Adobe Photoshop CS" to keystroke "s" using command down
end tell
end if
end tell
end repeat
changed your delay to 10 seconds for speed you can change it to 600 if you wish…