Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ghostrider157

macrumors newbie
Original poster
Jan 17, 2008
1
0
So I love the application pages with one exception. I hate that it doesn't have an autosave feature. Now I have managed to find a script that autosaves pages when it is open, but how do I add to that script to make the script terminate when pages closes. The code so far is:

Code:
repeat
	delay 20
	tell application "Pages" to save front document
	beep
end repeat

and I have a program to open this app when pages launches, but i need help adding to the code to terminate the app when pages terminates.
 

xUKHCx

Administrator emeritus
Jan 15, 2006
12,583
9
The Kop
I don't have pages to test but I have inserted your bit of code into a script I use to run another application in a similar manner. What I do is save this as a application and call it PagesLaucnher or something like that and give it the same icon and then just use this in the dock to launch the pages app.


tell application "Pages" to activate

set apprunning to true

repeat until apprunning is false
tell application "System Events"
set myList to (name of every process)
end tell
if (myList contains "Pages") is false then
set apprunning to false
else
set apprunning to true
delay 20
tell application "Pages" to save front document
beep
end if
delay 6
end repeat
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.