tell application id "com.figure53.QLab.5" to tell front workspace
set userText to text returned of (display dialog "Enter FOUR PLAYER NAMES, separated by a space:" default answer "" buttons {"OK"} default button "OK")
set nameList to words of userText -- ### Assuming that since the original request was for no spaces, the names can be space-delimited rather than comma-delimited?
repeat with n from 1 to 4
set eachName to item n of nameList
set text of cue ("Name" & n) to eachName -- ### As q number MUST be unique you can address the cue directly rather than using the "first cue whose q number is" form
set text format of cue ("Name" & n) to {fontFamily:"Arial", fontStyle:"Bold", fontSize:100} -- ### Can this not be set ONCE AND FOR ALL before running this script, rather than every time?
set text of cue ("Player" & n) to eachName
set text format of cue ("Player" & n) to {fontFamily:"Arial", fontStyle:"Bold", fontSize:100} -- ### As above
set text of cue ("Nameboard" & n) to eachName
set text format of cue ("Nameboard" & n) to {fontFamily:"Arial", fontStyle:"Bold", fontSize:100} -- ### As above
end repeat
end tell
--
Contact support anytime: sup...@figure53.com
User Group Code of Conduct: https://qlab.app/code-of-conduct/
Instagram: https://www.instagram.com/Figure53
TikTok: https://www.tiktok.com/@QLab.app
Bluesky: https://bsky.app/profile/qlab.app
---
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 visit https://groups.google.com/d/msgid/qlab/2c5aaf52-f569-4152-a861-2ae59835bcden%40googlegroups.com.
-- set text of Text cues from user input
-- Assumes 3 sets of Text cues numbered name1 .. name4 etc
tell application id "com.figure53.QLab.5" to tell front workspace
-- text formats, defined here for clarity
set ceris to {red:1, green:0, blue:0.6, alpha:1}
set white to {red:1, green:1, blue:1, alpha:1}
set paleBlueGreen to {red:0.8, green:1, blue:1, alpha:1}
set nameFormat to {rgbaColor:paleBlueGreen, fontName:"Verdana", fontSize:36}
-- if the format never changes, you could do this once in a different script or cue Template
set playerFormat to {rbgaColor:paleBlueGreen, fontSize:100}
set playerFormat to {rgbaColor:ceris, fontName:"Verdana", fontSize:102}
set nameBoardFormat to {rgbaColor:white, fontSize:104}
-- apply text format; don't need a loop here, using the 'cues whose .. condition'
set text format of cues whose q number begins with "name" to nameFormat
set text format of cues whose q number begins with "player" to playerFormat
set text format of cues whose q number begins with "nameboard" to nameBoardFormat
set namesList to words of text returned of (display dialog "Enter 4 Names" default answer "John Paul George Ringo" with title "Player Names")
repeat with n from 1 to 4
-- only reference the list once
set myname to item n of namesList
try
set text of cue ("name" & n) to myname
set text of cue ("player" & n) to myname
set text of cue ("nameboard" & n) to myname
-- fail silently if the cue/number doesn't exist
end try
end repeat
end tell