I have a flow where I use a script (Javascript) to pull some variables from some job metadata.
I then want to pass these variables to an AppleScript so that I can do some AppleScript commands.
Is the best way to do this to have two script elements, as in:
- Use Scripting Element 1 (Javascript) to get my variables
- Write them as PrivateData into the job
- Use Scripting Element 2 (AppleScript) to get my variables from PrivateData
I appreciate I can get variables from metadata using Applescript of type:
Code: Select all
set myEmailSubject to evaluate variable as string of j variable "[Metadata.Text:Path=\"/email/subject\",Dataset=\"XML-FromEmail\",Model=\"XML\"]"
If the above is the correct approach, how do I read a privatedata var in AppleScript.
For example, let's say the Javascript returned:
Code: Select all
job.setPrivateData("EmailSubject", emailSubject);
Thanks, Pat