Problem with Quark droplet

Hi all, i’m using following droplet-code to let Quark batch the dropped files to postscripts. If you have a quark-doc with, say 4 pages, it makes a 4 postscripts,1 of every page. You can drop multiple quark-docs on the droplet…I found it on http://homepage.mac.com/e_s_m and it works great!!

When run it asks for the filename to give the new postscripts. For example if you type “magazine_34_” it will name the batched postscripts “magazine_34_1”, “magazine_34_2” etc.etc. Perfect, but now i have quark-docs with only one page per doc and i want the postscript to have the exact same name as the quark-doc. Can somebody help me with this??



property DocumentPath : ""

on run
	display dialog "Drag QuarkXPress documents" & return & "on me for creating PostScript from each page of them�" with icon stop
end run

on open _selection
	tell application "Finder" to �
		set _files to files of selection
	set DocumentPath to (new file with prompt �
		"Please, set destination and name for output files�" default name "PSfile ") as string
	repeat with j from 1 to length of _files
		process_document(item j of _files)
	end repeat
end open

on process_document(processing_doc)
	tell application "QuarkXPress Passport� 4.11"
		open processing_doc use doc prefs yes
		tell document 1
			set processing_pages to name of pages
			if class of processing_pages is not list then �
				set processing_pages to coerce processing_pages to list
			set doc_name to name
			set page_width to (page width as real) + 6 -- bleed*2 value
			tell print setup
				ignoring white space and case
					set adjust horizontal tile to false
					--lots of properties settings here
				end ignoring
			end tell
			repeat with i from 1 to length of processing_pages
				set processing_page to item i of processing_pages
				show page processing_page
				set PS_file_path to coerce (DocumentPath & processing_page) to string
				print page processing_page �
					copies 1 cover page no OPI include images �
					PostScript file PS_file_path
			end repeat
			close saving no
		end tell
	end tell
end process_document

Thanks for any help!!

Fuut

Hi,

You should replace the following code:


set DocumentPath to (new file with prompt ¬ 
      "Please, set destination and name for output files…" default name "PSfile ") as string 

to:


set DocumentPath to (choose folder with prompt ¬
	"Please, set destination folder") as string

Then replace:


set PS_file_path to coerce (DocumentPath & processing_page) to string 

to


set PS_file_path to coerce (DocumentPath & doc_name & ".ps") to string

This should help. :slight_smile:

Paff the man!! thank you so much! exactly what i want!

Hi again, my wish has changed a bit, cause of an another case…We take off at the original script, at the top of this page. With that script you can choose a filename and a folder to save the Postscripts in. But the folder is consistent, it’s always the same folder. I tried changing the first line adding the full path:


property DocumentPath : "MAC HD:Desktop Folder:brand new ps"

But further in the code there’s this line:


set DocumentPath to (new file with prompt ¬
		"Please, set destination and name for output files…" default name "PSfile ") as string

I understand this line is asking for the destination folder and ignores the first line. What i want is that it asks for the filename but for the destination folder to be already set in the right location, like : MAC HD:Desktop Folder:brand new ps. So that i only have to type the filename and not clicking and clicking till i found the correct folder! :?

Of course this is possible, but HOW is the question! Thnx in advance! :smiley:

pfff, sorry for the silly question…it’s ok now! :lol: