0

I'm trying to set a variable using AppleScript from automator:

    do shell script "launchctl setenv LASTMAX \"" & today & "\""

I have a variable today that i want to assign to the variable LASTMAX

but when i check the property with echo $LASTMAX i keep getting the initial value, even after i reboot.

How can i set variables with AppleScript?

Is there a different way to store persistant variables with automator?

Thanks!

3
  • 1
    You can use a script to store variables... stackoverflow.com/questions/13325386/… Commented Apr 14, 2013 at 11:05
  • Thanks! That's just what i was hoping for Commented Apr 14, 2013 at 11:18
  • storing the script seems to only work the first time. It doesn't replace the property in the file once it is created. Commented Apr 14, 2013 at 13:05

1 Answer 1

1

You can use script objects to store your data in an out of the way place. Persistant variable storage in Automator

storing the script seems to only work the first time.

When I paste the script refernced above into an Automator workflow and run the workflow several times, the returned value increments by one each time the script is run. Please post your code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.