Copy text of text cue in lab

Hi Pros,

I met the following problem. I have a Q5 project that has 4 text cues. I call three cues to “source” (myF1, myF2, myF3). And the 4th one is the target text cue.
I’d like to copy, in order, the origin cue text to the target cue text. It is not a big challenge. In the origin text has formatting infos. The size and color of text lines are not the same. Well, I also want to include the formatting informations as well.
I wrote a script but it didn’t meet of my expectations. You know I am not pro scripter.
I show my code lines:

tell application id "com.figure53.QLab.5" to tell front workspace
	-- oigin cues in order
	set textOrder to {"myF1", "myF2", "myF3"}
	-- the destination cue is mytext
	
	log textOrder's item 1
	set theCue to cue (textOrder's item 1)
	tell application "System Events" to keystroke "c" using command down
	set myText to text of theCue
	log myText
	set selected to the cue "myTxt"
	set text of last item of (selected as list) to myText
	tell application "System Events"
		click menu item "Paste and Match Style" of menu 1 of menu bar item "Edit" of menu bar 1 of application process "QLab"
	end tell
end tell

where is the error, please help me to correct the script.

Thank you in advance!

Best,

Kalman

I’m not familiar with QLab, but I installed it to check it out…

It isn’t entirely clear what you’re trying to achieve, but QLab has an extensive AppleScript dictionary, so I have to think there’s a more direct way of achieving what you want without resorting to copy/paste.

What your script (almost) does is copy the text of the cue ‘myF1’ to the text of the cue ‘myTxt’.

from whatI gather you also want to copy the formatting of that text, right?

What’s confusing me is the part where you have multiple sources ( {“myF1”, “myF2”, “myF3”} ) and it isn’t clear to me what you expect to have in the myTxt cue at the end.

Either way, I cleaned up your script a little to get rid of the copy/paste approach, and to copy the text and the formatting of myF1 into myTxt. Hopefully that gets you on the right path, and we can work on the other cues as needed:

tell application id "com.figure53.QLab.5" to tell front workspace
	-- origin cues in order
	set textOrder to {"myF1", "myF2", "myF3"}
	
	-- get the first cue
	set theCue to cue (textOrder's item 1)
	-- get the text of that cue
	set myText to text of theCue
	-- get the text formatting (color, size, etc.) of the cue
	set myTextFormat to text format of theCue
	
	-- now target the destination cue
	tell cue "myTxt"
		set its text to myText
		set its text format to myTextFormat
	end tell
end tell