Thanks.
Rich
________________________________________________________
WHEN REPLYING, PLEASE QUOTE ONLY WHAT YOU NEED. Thanks!
Change your preferences or unsubscribe here:
http://lists.figure53.com/listinfo.cgi/qlab-figure53.com
New cues are made and added under the current selection, so if you set
the playback position to a cue inside the group the next cue will be
made under it (inside the group).
Also, here's an example of moving cues around, where:
"A" = the number of a the cue list
"1" = the number of a group cue in the list
"2" = the number of another cue in the list
tell application "QLab"
tell workspace 1
move cue "2" of cue "A" to end of cue "1" # move cue 2 to the end
of group 1
end tell
end tell
When testing this script I discovered a bug, which is that the error
handling doesn't properly protect you from moving cues around when
they are referenced incorrectly. i.e. it doesn't properly protect you
from trying to do this:
move cue "2" to end of cue "1"
I need to either add support for this formulation or properly prevent
it from doing anything. Watch out for that.
Best,
Chris
> Also, here's an example of moving cues around, where:
>
> "A" = the number of a the cue list
> "1" = the number of a group cue in the list
> "2" = the number of another cue in the list
>
> tell application "QLab"
> tell workspace 1
> move cue "2" of cue "A" to end of cue "1" # move cue 2 to the
> end of group 1
> end tell
> end tell
I can only get this to work by referencing q number directly - which,
if it doesn't already exist on a cue, leads me to this startlingly
cumbersome thing to take a selected Audio Cue and turn it into the
first cue of a new Group Cue (which is a step I'd like to add to
another bigger script):
tell application "QLab"
set existingNumbers to {}
set availableNumber1 to 9998
set availableNumber2 to 9999
repeat with eachCue in cues of front workspace
set existingNumbers to existingNumbers & q number of eachCue
end repeat
repeat while (availableNumber1 as string) is in existingNumbers
set availableNumber1 to (availableNumber1 * (random number) as
integer)
end repeat
set existingNumbers to existingNumbers & (availableNumber1 as string)
repeat while (availableNumber2 as string) is in existingNumbers
set availableNumber2 to (availableNumber2 * (random number) as
integer)
end repeat
set theAudioCue to (last item of (selected of front workspace as list))
if q number of theAudioCue is "" then
set q number of theAudioCue to availableNumber1
end if
set theAudioCueNumber to q number of theAudioCue
make (the front workspace) type "Group"
set theGroupCue to (last item of (selected of front workspace as list))
if q number of theGroupCue is "" then
set q number of theGroupCue to availableNumber2
end if
set theGroupCueNumber to q number of theGroupCue
set mode of theGroupCue to fire_first_enter_group
tell front workspace
move cue theAudioCueNumber of the current cue list to end of cue
theGroupCueNumber
end tell
if q number of theAudioCue is (availableNumber1 as string) then
set q number of theAudioCue to ""
end if
if q number of theGroupCue is (availableNumber2 as string) then
set q number of theGroupCue to ""
end if
moveSelectionDown (the front workspace)
end tell
As you can see, I really don't know what I'm doing here! There must be
an easier way; this script doesn't even have a routine to check that
the Audio Cue isn't already in a Group Cue yet...
Sorry I can't work this out on my own!
You can, of course, sort of get around this by creating a new cue list
and adding cues to it. Then you can manually turn that into a group
cue and do what you will to it.
On Sep 22, 2009, at 8:44 PM, Rich Walsh wrote:
--
Jeremy Lee
Sound Designer, NYC - USA 829
http://www.jjlee.com
On the subject of group cue scripting, and in general the limitations
you're discovering when manipulating workspace data from scripts:
This is all very helpful information and I intend to use it to improve
the scripting hooks. To be honest I was expecting them to be
deficient in many ways, but I wasn't sure specifically HOW they'd be
deficient until people really started using them heavily. Now that
you have, you're discovering all the important omissions. This is
great! (And sorry for any rough patches in the meantime.)
I've got a growing list of needed scripting improvements where I'm
filing your observations. Thanks much.
-C
I've got a growing list of needed scripting improvements where I'm filing your observations. Thanks much.
> On the subject of group cue scripting, and in general the
> limitations you're discovering when manipulating workspace data from
> scripts:
Two more things specifically about groups:
1. I can't find a way of moving a cue that is already in a group - and
therefore need to protect against trying to do this. More precisely, I
can't find out what group a cue is in - without a lot of trial and
error. You can easily end up creating groups within groups, and then
it all starts falling over.
2. To avoid that you might think you could create your destination
group as a cue list, make cues in it and then move the cue list into
another cue list - but I can't do that either, as the move command
doesn't like things that exist in the workspace rather than cue lists
or group cues.
I've beaten it into enough shape to be getting on with though...
Rich