Friday, February 8, 2008

Autosave script for Keynote

Apple Tech Forums

As many of you may already realize there is no autosave feature that is native to Keynote for the Mac; so after searching around for a few I found this little script that should do the trick for you. Good Luck!!!
Hunter


Tired to press cmd + S ?

to autosave iWork's documents
paste this script in the Script Editor

menu > File > Save As…
uncheck screen at startup
check stay in background
save this script as an application

Install it as one of the applications launched at boot_time from the Accounts PreferencePane (tab Login Items)

Every ten minutes, if Pages or Keynote is in use, the open documents (already saved once) would be saved.

if Numbers is in use, the frontmost document will be saved.
If I made no mistake, if the document was never saved the "Save" dialog will ask you to save it. (OK, it works)

--SCRIPT autosave4iWork
property minutesBetweenSaves : 10

on idle
my auto4PK("Pages")
my auto4PK("Keynote")
my auto4Numbers()
return minutesBetweenSaves * 60
end idle

on auto4PK(theApp)
tell application "System Events" to set theAppIsRunning to (name of processes) contains "theApp"
if theAppIsRunning = true then
tell application theApp
repeat with aDoc in every document
if path of aDoc exists then
if modified of aDoc then save aDoc
end if
end repeat
end tell
end if
end auto4PK

on auto4Numbers()
set theApp to "Numbers"
tell application "System Events" to set theAppIsRunning to (name of processes) contains theApp
if theAppIsRunning = true then
tell application theApp to activate
tell application "System Events" to tell application process theApp to keystroke "s" using {command down}
end if
end auto4Numbers
--SCRIPT

4 comments:

ATMB said...

Wonderful.... you really saved my life, keynote crashes often (once an hour) and I make a lot of work every hour!!

Thank you very much!!!

Anonymous said...

Great script, essential for Keynote.

One little bug: the quotes around "theApp" in
tell application "System Events" to set theAppIsRunning to (name of processes) contains "theApp"
must be removed, otherwise the script does not work as advertised.

Markus van der Westhuizen said...

Wonderful application and it works well. I can't imagine my life without it!!!

The only negative comment I have is that I sometimes work with a doc that I really don't wish to save (reading a Microsoft Word file for example). When the save dialogue box pops up I would just click the cancel button and that in turn would open a pop-up saying AppleEvent handler failed.

Is there any way to modify the script to accommodate a Cancel without making a scene of it?

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!