Odd Applescript Error with 4.1 (4.1.1?) update

106 views
Skip to first unread message

nizer

unread,
Jun 27, 2017, 4:12:26 AM6/27/17
to QLab
When I opened my show file in 4.1.1 my main show applescript came back with an error.

I had the same script in QLab 4.0 and it worked fine.

set myTestVariable to "works odd"

set myWord to word 1 of myTestVariable

say myWord


ERROR: Expected end of line, but found number.



if I wrap this in a QLab tell and check Run in Separate Process

tell application id "com.figure53.QLab.4" to tell front workspace
set myTestVariable to "works odd"
        set myWord to word 1 of myTestVariable
        say myWord
end tell

it compiles but doesn't work and still highlights the "1" as the error.

tell application "QLab 3"

set myTestVariable to "works odd"

set myWord to word 1 of myTestVariable

say myWord

end tell


works fine.



nizer

unread,
Jun 27, 2017, 4:27:01 AM6/27/17
to QLab
I think this might be related to the fact that Applescript reserves the word "WORD" for it's own.

It looks like QLab 4.1 added "word" to it's own dictionary.

text format recordn

properties

fontFamily (text) : The font family for this format. (e.g. "Helvetica", "Courier New")

fontStyle (text) : The font style (face) for this format. (e.g. "Regular", "Light Oblique")

fontName (text) : The font name for this format. (e.g. "CourierNewPS-BoldItalicMT")

fontSize (real) : The font size for this format.

lineSpacing (real) : The line spacing for this format.

rgbaColor (rgba color record) : An RGBA color record representing the percentage values for the red, green, blue, and alpha components of the color of this format.

range (range record) : A range record representing the index and length for the substring that has this format.

word (integer) : An optional 1-indexed word number to which this format should be applied. When used, the "range" property will be ignored. (setting only)

Andy Lang

unread,
Jun 27, 2017, 9:00:33 AM6/27/17
to ql...@googlegroups.com
That's correct, Mark. We're working on fixing that, but in the meantime, use "text item 1" instead of "word 1" and it should work!

-Andy

--
Contact support anytime: sup...@figure53.com
Follow Figure 53 on Twitter: http://twitter.com/Figure53
---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/daa657e0-2879-49a9-a8a4-7f6b5cb6fae5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nizer

unread,
Jun 27, 2017, 10:39:58 AM6/27/17
to QLab
Thanks that worked. The other issue is that I now get a "Access not allowed" alert when I try to current date via applescript.

I assume this has to do with the disabling of disruptive system behaviors? Any work around?

on getTimeInHoursAndMinutes()
set timeStr to time string of (current date)
set computertime to time string of (current date)
set Pos to offset of ":" in timeStr
set theHour to characters 1 thru (Pos - 1) of timeStr as string
set timeStr to characters (Pos + 1) through end of timeStr as string
-- Get the "minute"
set Pos to offset of ":" in timeStr
set theMin to characters 1 thru (Pos - 1) of timeStr as string
set timeStr to characters (Pos + 1) through end of timeStr as string
--Get "AM or PM"
set Pos to offset of " " in timeStr
set theSfx to characters (Pos + 1) through end of timeStr as string
return (theHour & ":" & theMin & " " & theSfx) as string
end getTimeInHoursAndMinutes

luckydave

unread,
Jun 28, 2017, 3:02:53 PM6/28/17
to ql...@googlegroups.com
This is a result of the new Text cue additions to QLab's AppleScript hooks in QLab 4.1. We've resolved this by working around some of AppleScript's reserved terms, such as "word" and "offset", in the current beta version of QLab 4.1.2. You can download the current beta here:



--
luckydave
Reply all
Reply to author
Forward
0 new messages