SKaplanOfficial/PyXA

`PyXA.AppleScript.load` removes curly braces, breaking AppleScript lists read in from external files.

paulfioravanti opened this issue · 0 comments

If I initialize a PyXA.AppleScript class with an AppleScript code string containing a list, the code is read in correctly as expected:

>>> import PyXA
>>> script = PyXA.AppleScript('set theList to {"foo", "bar"}')
>>> script.script
['set theList to {"foo", "bar"}']

However, if I have an AppleScript file with the same code, and read it in with PyXA.AppleScript.load, the curly braces get unexpectedly removed, causing the script to error out:

test.applescript

on run
  set theList to {"foo", "bar"}
end run

(Following on from the previous command prompts...)

>>> file_script = PyXA.AppleScript.load("test.scpt")
>>> file_script.script
['on run', '\tset theList to "foo", "bar"', 'end run', '']