Quark Collect for Output script

Hello,
Trying to adapt a script I found online that will sort of act as a quick key or shortcut to make Quark Xpress 7.2 do a “Collect for Output”

Here is the script

my doMenu_SE("File", "Collect for Output...")

on doMenu_SE(This_Menu, First_Level)
	tell application "QuarkXPress"
		tell application "System Events"
			tell process "QuarkXPress"
				set ascii0 to ASCII character 0
				set frontmost to true
				tell menu bar 1
					if class of This_Menu is string then
						set This_Menu to (This_Menu & ascii0)
					end if
					tell menu bar item This_Menu
						tell menu 1
							click menu item First_Level
							
						end tell
						
					end tell
				end tell
			end tell
			
		end tell
	end tell
end doMenu_SE

When I run the script I get this in my Events window:
click menu item “Collect for Output…” of menu 1 of menu bar item "File of menu bar 1 of process “QuarkXPress”
“System Events got an error: NSReceiverEvaluationScriptError: 4”

Any ideas? Thanks.

More info: I did enable GUI scripting using the Applescript Utility app, but I still get the error.

Okay,
Here’s the solution

my doMenu_SE(3, 15)

on doMenu_SE(This_Menu, First_Level)
	tell application "QuarkXPress"
		activate
		tell application "System Events"
			activate
			tell process "QuarkXPress"
				set ascii0 to ASCII character 0
				set frontmost to true
				tell menu bar 1
					if class of This_Menu is string then
						set This_Menu to (This_Menu & ascii0)
					end if
					delay 1
					tell menu bar item This_Menu
						tell menu 1
							click menu item First_Level
							
						end tell
						
					end tell
				end tell
			end tell
			
		end tell
	end tell
end doMenu_SE

I also turned off all languages except English

Cheers

Hi

You can add keyboard shortcuts to this command in Quark via "System Preferences/Keyboard & Mouse/ Keyboard Shortcuts
Without using applescript at all!
I have my collect for output set to (command & F3)
I guess its not as much fun as scripting it though!!