Help a newbie with an applescript for pages

Discussion in 'Mac Programming' started by ghostrider157, Jan 17, 2008.

  1. ghostrider157 macrumors newbie

    Joined:
    Jan 17, 2008
    #1
    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.
     
  2. xUKHCx Administrator emeritus

    xUKHCx

    Joined:
    Jan 15, 2006
    Location:
    The Kop
    #2
    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.


     
  3. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #3
    every 6 seconds seems a bit frequent to autosave.
     
  4. xUKHCx Administrator emeritus

    xUKHCx

    Joined:
    Jan 15, 2006
    Location:
    The Kop
    #4
    Well actually it is every 26 seconds and I merely cut and shunted their code into mine.
     
  5. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #5
    So it is, I blame my iPod Touch which I was viewing the site on at the time.
     
  6. MacGeek7 macrumors 6502a

    MacGeek7

    Joined:
    Aug 25, 2007
    #6
    This is a very handy application - thanks for this
     

Share This Page