Save variables in AppleScript?

Discussion in 'Mac Programming' started by JasonZ, Aug 28, 2010.

  1. JasonZ
    Expand Collapse
    macrumors newbie

    Joined:
    Aug 28, 2010
    #1
    Is it possible to save changes made to a variable from run to run? For example have a certain set of code only run the first time you execute the script?
     
  2. angelwatt
    Expand Collapse
    Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Write them to a file and read them back at the beginning of the run.
     
  3. larkost
    Expand Collapse
    macrumors 6502a

    Joined:
    Oct 13, 2007
    #3
    AppleScript technically has something that will do it: OSAStore and OSALoad, but I would recommend relying on this and read/write this in a more conventional way from a file.
     
  4. JasonZ
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Aug 28, 2010
    #4
    Im sorry but im lost... I have no idea how to do what either of you suggested... :confused:
     
  5. angelwatt
    Expand Collapse
    Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #5
    Then Google for "applescript save open file"
     

Share This Page