sunday question

86 views
Skip to first unread message

Kalman Tarr

unread,
Feb 18, 2023, 6:58:16 AM2/18/23
to QLab
Good Morning everyone on sunday,

This is my problem on today.
I am working on how to select audio or video cues in different way.
(select them based on  q type or extension, etc) 

And now, I would like to use the file 'type identifier' of the 'target of the cue'.
I show the initial solution without tell - end tell block:

    set theType to q type of last item of (selected as list)
   
    set validTargets to file target of last item of (selected as list)
   
    tell application "System Events"
        set typeIDE to (type identifier of (validTargets as alias)) as text
    end tell
   
    display dialog validTargets as text with title typeIDE as text
   
    tell application "System Events"
        --
How can I choose CUES in given cue list by its type identifier
        --set selected to cues whose type identifier of validTargets is typeIDE as list
    end tell

How to select the CUES in the given cue list based on their type Identifier which I got earlier in this script.

Thanks for your attention on Sunday.
Best 
Kalman

Taylor Glad

unread,
Mar 5, 2023, 1:53:46 AM3/5/23
to QLab
This works for me:



tell application id "com.figure53.QLab.5" to tell front workspace
-- get the type identifier of the file target for the last selected cue
set selectedCue to last item of (selected as list)
set targetTypeIdentifier to my getTypeIdentifier(selectedCue)

set selectedCues to {}
repeat with thisCue in (every cue of current cue list)
if my getTypeIdentifier(thisCue) is targetTypeIdentifier then
set end of selectedCues to thisCue
end if
end repeat
set selected to selectedCues
end tell

on getTypeIdentifier(aCue)
tell application id "com.figure53.QLab.5" to tell front workspace
set targetPath to file target of aCue
end tell
tell application "System Events" to return (type identifier of (targetPath as alias) as text)
end getTypeIdentifier

Kalman Tarr

unread,
Mar 6, 2023, 6:00:31 AM3/6/23
to QLab
Hi Taylor, (I don't see exactly last character of your name) 
It looks very interesting solution. I am going to try it. Hope it works for me , too.

Best 

Kalman
Reply all
Reply to author
Forward
0 new messages