I am trying to simply print a postscript file to a watched folder with Illustrator and InDesign, using a printer preset.
I have done this, successfully, with Quark.
Is there an inherent bug in both Illustrator and InDesign that keeps it from doing these things?
In the example below, I’ve told it to print using the default preset, and it doesn’t even want to do that.
tell application "InDesign CS"
activate
set user interaction level to never interact
tell document 1
print using printer preset default
end tell
end tell
and of course it fails when i try to print with the preset that i actually want to use.
tell application "InDesign CS"
activate
set user interaction level to never interact
tell document 1
print using printer preset "xxx"
end tell
end tell
I work for a financial corp and I don’t think I should include certain things, the name of the preset is not “xxx”, but it’s real name would give some things away.
Can anyone help me out with this?
Model: Dual 2GHz G5, 1 GB
AppleScript: 2.0
Browser: Safari 312
Operating System: Mac OS X (10.3.9)
tell application "InDesign CS"
set user interaction level to never interact
tell document 1
set print file of (print using "xxxx") to ":Volumes:distiller:In:tester.ps"
end tell
end tell
For some reason, that doesn’t work for me.
Although, it does make a lot of sense.
Model: Dual 2GHz G5, 1 GB
AppleScript: 2.0
Browser: Safari 312
Operating System: Mac OS X (10.3.9)
I don’t think you can combine the commands in one line like you have it, but I’m not sure. From what I understand of AS, it will try to execute the parenthetical command first then continue on with the rest of the line. So it will first try to 'print using “xxx” then set the print file, which is backwards from how you need it to execute. Try setting the print file of the printer preset in a separate line then try the ‘print using’ line.
Oh, and don’t put it in the ‘tell document 1’ line because printer presets are independent of documents, they are contained by the application object. To be clear: the print line would then be…
InDesign CS got an error: Can’t set print file to “Volumes:DistillerIHT:In:tester.ps”.
with this script…
tell application "InDesign CS"
set user interaction level to never interact
set print file to "Volumes:DistillerIHT:In:tester.ps"
print document 1 using "IHT - S & P Fund"
--set print file of (print using "IHT - S & P Fund") to "Volumes:DistillerIHT:In:tester.ps"
end tell
I think the problem might be with your path. What this path is describing is file “tester.ps” of folder “In” of folder “DistillerIHT” of disk “Volumes”. But you might mean, “DistillerIHT:In:tester.ps”, i.e. file “tester.ps” of folder “In” of disk “DistillerIHT”. I just want to be sure since it should otherwise work.
Run the following script:
tell application "Finder" to exists item "Volumes:DistillerIHT:In:"
If it returns false, then the ID script is failing because the folder to make the PS file in doesn’t exist.
well, volumes is a folder, and a server, when mounter, is simply a folder, either path type should work just fine.
Just so you know, the script you wrote comes out “true” with and without volumes.
this script once, again, doesn’t work…
tell application "InDesign CS"
set print file of printer preset "IHT - S & P Fund" to "DistillerIHT:In:tester.ps"
print using "IHT - S & P Fund"
end tell
Does anyone here have experience with this? I have done it very successfully with Quark in the past.
I’m really starting to think that it is a bug or error with the apps.
Well, it’s a gigantic script with a lot of irrelevant stuff, but here’s the handler that deals with outputting the PS:
on printPS(theFile)
set docName to ensureDocExists(theFile)
copy parseJobFileForInfo(theFile) to {lfRange, jobName}
set psPath to verifyFolderMakeIfNil(containerPath(theFile) & "pdf-ps:", true) as text
set psPath to psPath & "seps" & lfRange & ".ps"
set theResult to ""
tell application "InDesign CS"
set printSet to printer preset "Output PostScript 100lpi"
set print file of printSet to psPath
try
print document docName using printSet without print dialog
set theResult to psPath
on error
copy "Couldn't print to PostScript" to end of myErrors
set theResult to "error"
end try
end tell
return theResult
end printPS
One more question: Are you certain printer preset “IHT - S & P Fund” exists?