Quark to PostScript - how can I influence the path?


I have a Problem with QuarkXPress 4.1
I would like to print a document as PostScript. I tried it with following code:

print front document PostScript file alias

It works fine, but I find no way to influence, where to save the File and with which name to save it. I tried it with the alias but the File gets always created on Desktop.

Where is my Mistake?

Could somebody help me please?

Greetz Pesse

Hi there,

Your main mistake is hard coding the text ‘alias’. The syntax requires a variable whose ‘class’ is an alias or whose class can be coerced to an alias. (Note: The variable ‘filePath’ is a string, but the coercion is handled for you)

Try this…

set filePath to "Hard Drive:Folder 1:Folder 2:Filename.ps"
tell application "QuarkXPress™ 4.11"
	tell document 1
		print page 1 PostScript file filePath
	end tell
end tell

Of course, you’ll need to substitute the file path to something that’ll work on your mac. If your hard drive isn’t named Hard Drive, or if Folder 1 and Folder 2 don’t exist, the code will error.

I’m a little pushed for time right now, but this should at least get you started.

If you get stuck, post back and I’ll get back to you as soon as I can.




Thanks for answering, but I really knew that. Sorry, it was my fault - i should explain better.

Yes I have a working Alias there, but the File is always created on Desktop with the Name of the document. I can’t influence the path…
I tried it with an Alias to a file on HardDrive, but always get this PDF on the Desktop…

I hope, now you understand a bit better what my problem is.

Greetz Pesse

OK. No problem.

Here are a few more ideas, though it would be extremely useful if you could post some code so I can see what’s going on.

When you say you have a ‘working alias’ I wonder if maybe you’ve misunderstood the context of the term ‘alias’. Please forgive me if you already get it, but… What’s required in this script is not the path to an existing file, but the complete path you’d like the new file to have. Thus, the file path ‘Hard Drive:Folder 1:newFile.ps’ will create a file named ‘newFile.ps’ in Folder 1 of the drive named Hard Drive. There shouldn’t be a file of that name in this location before the script starts.

The other thing I find confusing is that you say you ‘…always get this PDF on the desktop’.

The script creates only PS files, not PDF files. In order for a PDF to appear you must be distilling the PS file at some point. It could be this that’s causing the problem.

Perhaps you might try creating the PS file without distilling it, that way you’ll see exactly where the script is putting the PS file.

As I said before, it would help in this instance if you posted your current code so we can take a look. Does it look similar to my code? Did you actually compile and run my code (with the necessary alterations)?

Bye for now,


Hi Juerg

Thanks for your answering!
Yesterday, I tried and tried and tried till I had my solution. The reason why the PS was not created on the Path I typed is, that the Mac I use had terribly mistakes. I installed Quark again and - now it works clearly.

The other thing is with the PDF. I was not correct informed by my Team-Members. Usually I don’t work with quark and so I thought, the PDF would be created directly → it was fault ;o) But now I know, what I need to complete my script - I asked my master , who is a really Mac-Crack g

Thanks again for answering.

Greetz Pesse


Glad to hear you fixed your problem. Sometimes a re-install works wonders!