Hi All Need a hand if is someone has a spare minute?

I have the following code to open a quark file in Quark and the print it to a posctscript file.

However the file opens up in Quark but scripter gives a error of QuarkXPress got an error: Can’t make some data into the expected type.

Here is the code any help appreciated:

–SET THE FOLDER PATH VARIABLES

set the work_folder to (choose folder) as alias
set the output_folder to (choose folder)

–CREATE LIST OF FILES IN WORK_FOLDER PATH

tell application “Finder”
set the file_list to (every file in work_folder) whose name extension is “qxp”
end tell

–BEGIN LOOP OF SAVING TO POSTSCRIPT FORMAT

repeat with i from 1 to number of items in file_list
–DECLARE ALL LOOP VARIABLES

set the q_file_name to (name of item 1 of file_list & ".qxd")
set the q_file_open_path to work_folder & q_file_name
set the q_window_name to q_file_name & " : Layout 1"
set AppleScript's text item delimiters to "."
set the ps_file_name to first text item of q_file_name & ".ps"
set AppleScript's text item delimiters to ""

-- OPEN OR BRING QUARKXPRESS 6 TO THE FOREGROUND AND OPEN CURRENT FILE

tell application "QuarkXPress Passport"
	activate
	open q_file_open_path
end tell

repeat until exists window q_window_name of application "QuarkXPress Passport"
	delay 1
end repeat

--START PRINTING PROCESS

tell application "System Events"
	tell process "QuarkXpress Passport"
		keystroke P using {command down}
	end tell
	
end tell

Hi,

the problem occurs in this line


.
  set the q_file_open_path to work_folder & q_file_name
.

work_folder is an alias, q_file_name a string the concatenation results a list {alias "path:to:work_folder, “[filename]”}.
coerce work_folder to text


set the work_folder to (choose folder) as text

and add the keyword folder in


set the file_list to every file in folder work_folder whose name extension is "qxp"

System events is NOT required to print your Quark files either you can just “print PostScript file Some_File_Path” after using “print setup” to set up your required options.