Set property Command with Variable in it

BECOME PART OF THE COMMUNITY - Sign up here
  • Hi All,

    I wanna make a macro that sets the CMD of a Cue with the input of a variable

    The command that should be in the cue cmd is for example: Set UserVariable "Song 2"
    In this case Song 2 is coming from a variable.

    im trying it with:

    Set Cue 1 Part 1 Property "Command" "SetUserVariable InitialName "$Initial""

    But then i get

    "SetUserVariable InitialName Song 2"

    While i need to have a " in front of song and on the end of 2.

    Can someone help me with this ?
    Thanks!

  • the easiest solution is to use names without spaces, not needing quotes, to avoid the trouble with quotes inside quotes.

    e.g. use Song2 or Song_2 instead of "Song 2" as name


    nevertheless, if you need to use name with spaces, here's how:

    Set Cue 1 Part 1 Property "Command" "SetUserVariable InitialName '"$"Initial""'"


    segmented for easier understanding:

    Set Cue 1 Part 1 Property "Command" 
    "SetUserVariable InitialName '"
    $"Initial"
    "'"

    internal interpretation step1 replaces $vars with var-content and quoted $"vars" with quoted var-content

    Set Cue 1 Part 1 Property "Command" 
    "SetUserVariable InitialName '"
    "Song 2"
    "'"

    internal interpretation step2, concatenates consecutive doublequoted "strings":

    Set Cue 1 Part 1 Property "Command" "SetUserVariable InitialName '""Song 2""'"

    ->

    Set Cue 1 Part 1 Property "Command" "SetUserVariable InitialName 'Song 2'"

    resulting cuepart command, with singlequoted name:

    SetUserVariable InitialName 'Song 2'

    resulting actual execution, with doublequoted varname and varcontent:

    SetUserVariable "InitialName" "Song 2"

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!