
--QLab5 Version
--Create OSC List From Template with incrementing value replacing $$$
--Run in separate process should not be checked
display dialog "Number of cues to generate:" default answer "100"
if button returned of result = "cancel" then
return
else
set therepeat to (text returned of result) as integer
end if
display dialog "Starting value for variable?" default answer "1"
if button returned of result = "cancel" then
return
else
set theindex to (text returned of result) as real
end if
display dialog "Increment?" default answer "1"
if button returned of result = "cancel" then
return
else
set theincrement to (text returned of result) as real
end if
display dialog "Integer value format" buttons {"1", "1.0"} default button "1"
set integertype to button returned of result
tell front workspace
try
set the thedestinationpatch to network patch number of cue "OSCT"
repeat therepeat times
make type "network"
set theselectedcue to last item of (selected as list)
set the q number of theselectedcue to ""
set the network patch number of theselectedcue to thedestinationpatch
set thecustommessage to the custom message of cue "OSCT"
set AppleScript's text item delimiters to "$$$"
set the item_list to every text item of thecustommessage
if theindex mod 1 is 0 and integertype is "1" then
set AppleScript's text item delimiters to (theindex as integer) as string
else
set AppleScript's text item delimiters to theindex as string
end if
set thecustommessage to the item_list as string
set AppleScript's text item delimiters to ""
set the custom string of theselectedcue to thecustommessage
set theindex to theindex + theincrement
end repeat
end try
end tell

Yes, much of the Cookbook doesn't work with QLab 5.