My app iClip loads a specially named script (“iClip Events.scpt”) and then invokes handlers in it, e.g. to filter incoming data.
Now, when I tried to add some advanced features to the script, and I also had to include an ObjC framework for it, the script suddenly cannot access the app’s properties any more:
Here’s the code:
use framework "Foundation"
using terms from application "iClip"
on init
end init
on quit
end quit
on clip set switched
end clip set switched
on filter incoming flavors
get current clipping
end filter incoming flavors
on clipping added by recorder
end clipping added by recorder
on clipping added interactively
end clipping added interactively
end using terms from
If I remove the “use” line at the top, the error goes way.
Also, when I use the “current clipping” from a normal script, then it’s not a problem either (it’ll give a “missing value” but without giving an AS error or throwing an exception:
use framework "Foundation"
tell application "iClip"
get current clipping
end tell
So it only occurs with the using terms handlers.
What could be causing this?