Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Question:

Question: applescript property of called script not changing after loading and running

I have two scripts, callingScript and CALLEDscript. I want callingScript to be able to get any updated values of CALLEDscript properties but cannot get this to work.


My current test versions of the two scripts are:


CallingScript.scpt


display dialog "this is the start"

set theOtherScript to load script alias ((path to desktop as text) & "CALLEDscript.scpt")

run script theOtherScript

display dialog "this is nearly the end"

set receivedMessage to (theMessage of theOtherScript)

-->"blank to start with"


CALLEDscript.scpt

property theMessage : "blank to start with"

display dialog "Hello"

set theMessage to "no longer blank now"

log theMessage


Can someone please explain what I am doing wrong?

MacBook Pro with Retina display, OS X El Capitan (10.11.6)

Posted on

Reply

Page content loaded

Nov 15, 2017 8:50 AM in response to jbh2 In response to jbh2

The load script command creates a separate script object from the specified file. This script object is a part of the calling script - its properties are not saved back to the original file. There are a few strategies for persistent data stores, if you could explain exactly what it is you are trying to do.

Nov 15, 2017 8:50 AM

Reply Helpful
User profile for user: jbh2

Question: applescript property of called script not changing after loading and running