Can you point me in the right direction??

Here is the modified post Adam; Thanks.


I can’t seem to modify this script successfully.
It was to save eps pages as dcs2.0 which it does(this is just s sample)
My problem is that I can’t get it to assign new trap settings.
I thought I could simply change the opening line to “use doc prefs no”
but this does not do it.
Anyone know the reason?
-br


tell application "QuarkXPress"
	activate
	
	try
		-- This section will allow the user to specify which document to use, either the active document or browse to a document
		if (exists document 1) and doc format of document 1 is in {"XDOC", " .qxp", "XTMP"} then
			set whatDoc to button returned of (display dialog "Would you like to use the Active document or choose a new document?" buttons {"Cancel", "Choose", "Active"} default button "Active")
			if whatDoc is "Choose" then
				set File_Location to ((choose file of type {"XDOC", " .qxp", "XTMP"} with prompt "\"Select a QuarkXPress document.\"") as text)
				try
					open alias File_Location use doc prefs yes remap fonts no do auto picture import no
				end try
			end if
			if whatDoc is "Cancel" then error "User canceled." number -128
		else
			set File_Location to ((choose file of type {"XDOC", " .qxp", "XTMP"} with prompt "\"Select a QuarkXPress document.\"") as text)
			try
				open alias File_Location use doc prefs yes remap fonts no do auto picture import no
			end try
		end if
		
		-- This line allows the user to specify a folder into which the EPS files will be saved
		set DestFolder to (choose folder with prompt "Select a folder in which to the save the EPS files.") as text
		
		-- This section will parse the document name, to use when saving the EPS files
		tell document 1
			set DocName to name as text
			set olddelims to AppleScript's text item delimiters
			set AppleScript's text item delimiters to "."
			if text item -1 of DocName = "qxd" then
				try
					set DocName to text items 1 thru -2 of DocName
					set AppleScript's text item delimiters to olddelims
				on error errmsg
					set AppleScript's text item delimiters to olddelims
					log errmsg
				end try
			end if
			
			-- This section will cycle through the pages and save each as an EPS
			try
				set overwrite to null
				set curPage to page number of current page
				set pageCnt to count of pages
				repeat with i from 1 to count of pages
					-- This section will create the sequential number for the file
					set fileNum to ""
					repeat until (length of (fileNum as text)) = (length of (pageCnt as text))
						if fileNum = "" then
							set fileNum to i
						else
							set fileNum to "0" & fileNum
						end if
					end repeat
					
					-- This line will create the name for the file
					set FilePath to DestFolder & DocName & "_" & fileNum & ".eps"
					
					-- This following line will invoke a dialog for the first file whose name already exists
					-- This selection will be applied to subsequent files, so the dialog won't be display again
					set overwrite to my ifFileExists(FilePath, overwrite)
					
					-- The following section performs the save, if appropriate
					if overwrite is true or overwrite is null or overwrite is "temp" then
						save page i in FilePath EPS format PC DCS2 EPS data clean EPS OPI include images bleed ".125" scale 100 without transparent page
					else if overwrite is "Quit" then
						-- The user cancelled from the duplicate file notification dialog
						-- This will end the script
						error "User canceled" number -128
					end if
				end repeat
				
				-- The following beep will provide feedback of script completion
				beep 2
			on error errmsg number errnum
				error errmsg number errnum
			end try
		end tell
	on error errmsg number errnum
		if errnum is -108 then
			beep
			display dialog errmsg & return & return & ¬
				"Try allocating more memory to " & name & "." buttons {"OK"} default button 1 with icon stop
			return
		else if errnum is not -128 then
			beep
			display dialog errmsg & " [" & errnum & "]" buttons {"OK"} default button 1 with icon stop
		end if
		return
	end try
end tell

--=================================== Handlers =========================================
-- Below is the handler (subroutine) that is called from the above script
--===================================================================================

on ifFileExists(FilePath, bOverWrite)
	if bOverWrite is null then
		-- This section will check to see if a file exists, until a matching name has been found
		tell application "Finder"
			if exists alias FilePath then
				tell application "QuarkXPress"
					set overwrite to button returned of (display dialog "A file(s) with the same name already exists at this location. Saving will delete the existing file(s)." & return & return & ¬
						"Do you want to save anyway?" buttons {"Cancel", "Don't Save", "Save"} default button "Save" with icon caution)
				end tell
				if overwrite is "Save" then
					return true
				else if overwrite is "Don't Save" then
					return false
				else if overwrite is "Cancel" then
					return "Quit"
				end if
			else
				return null
			end if
		end tell
	else if bOverWrite is true then
		-- This section will keep creating files regardless of whether the names already exist
		return true
	else if bOverWrite is false or bOverWrite is "temp" then
		try
			tell application "Finder"
				if exists alias FilePath then
					-- This line will ensure that files whose names already exist are not created, 
					-- if you user previous chose to skip such file
					return false
				else
					-- This line will ensure that files whose names don't already exist will be created, 
					-- if the user previously chose to not overwrite existing files
					return "temp"
				end if
			end tell
		on error errmsg number errnum
			beep
			display dialog errmsg & " [" & errnum & "]" buttons {"Cancel"} default button 1 with icon stop
			return
		end try
	end if
end ifFileExists

I don’t use Quark, so can’t help you, but when you post a script, it’s very handy for readers to be able to download it to their own script editor with one click. To make that possible, click the AppleScript button above the Post’s text box in the new post or reply forms, and paste your script in between the square bracket tags that appear. I’ve done it for your script so folks who can help will just click the link at the top of the script box and your script will appear in their script editor. Handy! :slight_smile: You can see how that worked by looking at your post in raw form by clicking the “Edit” link.