| Author |
Message |
|
mpoulson
Joined: Jan 02, 2011 Posts: 2
|
 Embedded apple script reports compile error after osx update
i have a some simple scripts that stopped working and now will not compile after I took OSX update 10.6.5. An example script is - Code: Select all
if (value of variable "PCRbottomstate" as integer) is 9 then set value of variable "PCRbottomstate" to 1 else set value of variable "PCRbottomstate" to ((get value of variable "PCRbottomstate" as integer) + 1) end if
The variable PCRbottomstate exists and has a current value of 9. When I attempt to make changes then compile i get the following error: Error script error: around characters 22 to 23 Error script error: Expected “,” but found “"”. (-2741)
The editor highlights the double quote " just before the first PCRbottomstate variable ref.
|
| Sun Jan 02, 2011 9:09 pm |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6665 Location: Austin, Texas
|
 Re: Embedded apple script reports compile error after osx up
Try enclosing your scripts in a tell block: - Code: Select all
tell application "IndigoServer" [YOUR CODE HERE] end tell
We've had several cases where the AppleScript component becomes corrupt somehow and normal scoping rules aren't being followed correctly.
_________________ Jay (Indigo Support)
|
| Mon Jan 03, 2011 9:30 am |
|
 |
|
mat
Joined: Nov 25, 2010 Posts: 172 Location: UK
|
 Re: Embedded apple script reports compile error after osx up
I've got the same issue on about 70 different scripts
|
| Tue Jan 04, 2011 7:24 pm |
|
 |
|
mat
Joined: Nov 25, 2010 Posts: 172 Location: UK
|
 Re: Embedded apple script reports compile error after osx up
All my script errors were all with if statements if that's any assistance Jay. I have indigo check if a light is on before sending an unnecessary command to try to minimise signals backing up in the queue thus reducing a bottle neck at the cm15.
Not sure it was directly related to an os update though, as I was working on some simple script at the time it happend. I am on 10.6.5 installed 18th November 2010. Last software update was on the 23rd dec for iTunes and airport ...... I reboot whole mac weekly-ish.
Unless a indigo server reboot triggered it? I was starting and stopping indigo server quickly. Every 30 seconds or so, as I was also sorting out a problem where huristic (?) images were not displaying a lamp as being on when brightness was below 30 with the lowest image being say+ and say+30. Had to create images at +1,2,5,10,15,20,25 for lamps to be shown as on right the way through a dim.
I'm using 4.1.13 of indigo
Not sure if that assists in locating cause!?! But if you need more let me know.
Regards
Mat
|
| Tue Jan 04, 2011 8:21 pm |
|
 |
|
BillC
Joined: Mar 09, 2008 Posts: 183
|
 Re: Embedded apple script reports compile error after osx up
I've now got the same problem, fixed by using tell blocks. Not all embedded scripts give errors; for example, a simple handler call works without the tell block, as does "do shell script...". These statements in one script work without the tell block: - Code: Select all
set date_time_stamp to (current date) as string growlSecurity("Reminder", "The garage door has been open for one hour; if this was inadvertent, please close it." & return & return & date_time_stamp)
Ones that need the tell block are, as mat noted, "if" statements; also "remove delayed actions for" statements and "set value of variable" statements. Recently upgraded to 10.6.6; not sure if that's when the issue started, but it very well could be. IndigoServer version 4.1.15. Let me know if you need more info. Hope this is useful...
|
| Tue Jan 11, 2011 10:14 am |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6665 Location: Austin, Texas
|
 Re: Embedded apple script reports compile error after osx up
It's likely that the problem is when the script refers to Indigo objects (it seems to be a scoping error). I'd be interested to hear from others if a 'using terms from application "IndigoServer"' and 'end using terms' blocks rather than try blocks also works for everyone experiencing the problem.
_________________ Jay (Indigo Support)
|
| Tue Jan 11, 2011 10:41 am |
|
 |
|
BillC
Joined: Mar 09, 2008 Posts: 183
|
 Re: Embedded apple script reports compile error after osx up
jay wrote:I'd be interested to hear from others if a 'using terms from application "IndigoServer"' and 'end using terms' blocks rather than try blocks also works for everyone experiencing the problem.
"Using terms from" works here; I didn't change all of the embedded scripts but had no errors in a sample of about 25%.
|
| Tue Jan 11, 2011 11:38 am |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6665 Location: Austin, Texas
|
 Re: Embedded apple script reports compile error after osx up
Great info, thanks.
_________________ Jay (Indigo Support)
|
| Tue Jan 11, 2011 11:41 am |
|
 |
|
jenkins007
Joined: Nov 08, 2006 Posts: 74 Location: Seguin, TX
|
 Re: Embedded apple script reports compile error after osx up
I had the similar with embedded scripts. I just noticed it yesterday - no embedded scripts will work when they all worked prior. I am running 10.6.7 and indigo 4.1.16. This has happened before when scripts no longer worked and the fix was running disk utility and repairing permissions and running disk repair. This time neither fixed it. Zapped Pram too. I have lots and lots of embedded scripts so I was really scratching my head. Running from a different permission with a older OS (10.6.4) and older Indigo 4.1.xx) these same scripts worked. The scripts range from being fairly simple using variable substitution or other logic to rather complex logic. For example a simple one uses this line: set temp to value of variable "livingTemp" This errors out: Error script error: around characters 27 to 37 Error script error: A “"” can’t go after this identifier. (-2740)
The fix appears to be using the tell application "IndigoServer" statement.
Good thing this fixes it. I just completed going though all triggers, and actions and they all now work.
Hope the root cause is figured out! Good luck. The support on Indigo is the best!!!
Thanks Matt and the support team! Matthew
_________________ Thanks,
Matthew
|
| Sun Apr 03, 2011 7:15 am |
|
 |
|
dstrickler
Joined: Oct 08, 2010 Posts: 246 Location: Boston, MA
|
 Re: Embedded apple script reports compile error after osx up
I saw that need for "Tell" statement too and figured it was just my Mac being whacky after an O/S upgrade. Good to know!
_________________ Dave
|
| Sun Apr 03, 2011 7:20 am |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6665 Location: Austin, Texas
|
 Re: Embedded apple script reports compile error after osx up
jenkins007 wrote:The fix appears to be using the tell application "IndigoServer" statement.
Did you try 'using terms from "IndigoServer"' rather than a tell statement (as I requested above)? It would help to know if that works in trying to figure out what the OS corruption problem actually is doing. Unfortunately, it doesn't appear to be OS version related - we've had reports on every Snow Leopard version and, in fact, one report of it happening on Leopard as well. I suspect your 10.6.4 install just hadn't become corrupt in that special way... 
_________________ Jay (Indigo Support)
|
| Sun Apr 03, 2011 9:17 am |
|
 |
|
jenkins007
Joined: Nov 08, 2006 Posts: 74 Location: Seguin, TX
|
 Re: Embedded apple script reports compile error after osx up
I tried 'using terms from application "IndigoServer"' ending with the end using terms block. This erred out with Expected "using terms from", etc. but found identifier.
Changed it to 'using terms from "IndigoServer"' and it erred out with Can't make "IndigoServer" into type application.
Changed it to tell block and it works fine. Hope this helps! 
_________________ Thanks,
Matthew
|
| Mon Apr 04, 2011 6:06 am |
|
 |
|
jenkins007
Joined: Nov 08, 2006 Posts: 74 Location: Seguin, TX
|
 Re: Embedded apple script reports compile error after osx up
Going through the Indigo DB, looks like I adjusted all scripts and everything seems to be working fine.
My main control page shows an error when I open it for editing. Same issue with using embedded scripts. I found the controls using embedded scripts and adjusted them adding both the tell block on some and using terms from block on others. Both work and now all is running.
I communicated in my earlier post that the using terms block did not work... actually it does work. I was not using the correct closing statement... instead of ending with "end using terms" it needed to be "end using terms from".
So both the tell block and the using terms block works to fix this apple script issue. Thanks for the quick (and Sunday) reply! Excellent support!
_________________ Thanks,
Matthew
|
| Mon Apr 04, 2011 6:58 am |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6665 Location: Austin, Texas
|
 Re: Embedded apple script reports compile error after osx up
Thanks much - this reinforces the belief that it's a compile-time scoping issue. Maybe passing this information on to Apple will help them figure out what's wrong.
_________________ Jay (Indigo Support)
|
| Mon Apr 04, 2011 7:51 am |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: Embedded apple script reports compile error after osx up
jenkins007 wrote:...I was not using the correct closing statement... instead of ending with "end using terms" it needed to be "end using terms from"
Here is a simple tip to avoid that problem. Just end your blocks with end then compile. The compiler will automatically end the block with the correct syntax. This works in the AS editor, but I have not tested it inside of Indigo.
Last edited by berkinet on Mon Apr 04, 2011 5:49 pm, edited 1 time in total.
|
| Mon Apr 04, 2011 1:35 pm |
|
|