on open fileList
set deskPath to path to desktop as Unicode text
tell application "Finder"
repeat with i from 1 to count of items of fileList
set theFile to item i of fileList
-- Don't get names of files were not processing
if not ((kind of theFile starts with "Quark") or (kind of theFile starts with "InDesign")) then
display dialog "This file is not an InDesign or Quark document!" buttons "Skipping" default button "Skipping" with icon 0 giving up after 6
return
end if
--Determine whether to use InDesign subroutines or Quark subroutines
if (kind of theFile starts with "InDesign") then -- Process as InDesign
-- Get the name of "theFile" InDesign file
set fileName to name of theFile
my createInDesignPDF(theFile, deskPath, (text 1 thru -6 of fileName))
else -- Process as Quark
-- Get the name of "theFile" Quark file
set fileName to name of theFile
my createQuarkPDF(theFile, deskPath, (text 1 thru -6 of fileName))
end if
end repeat
end tell
end open
or
on open fileList
set deskPath to path to desktop as Unicode text
tell application "Finder"
repeat with i from 1 to count of items of fileList
set theFile to item i of fileList
-- Get name of all dropped files wether processing or not
set fileName to name of theFile
if not ((kind of theFile starts with "Quark") or (kind of theFile starts with "InDesign")) then
display dialog "This file is not an InDesign or Quark document!" buttons "Skipping" default button "Skipping" with icon 0 giving up after 6
return
end if
--Determine whether to use InDesign subroutines or Quark subroutines
if (kind of theFile starts with "InDesign") then -- Process as InDesign
my createInDesignPDF(theFile, deskPath, (text 1 thru -6 of fileName))
else -- Process as Quark
my createQuarkPDF(theFile, deskPath, (text 1 thru -6 of fileName))
end if
end repeat
end tell
end open
Mark-first script-same message about variable not defined.
Second Script- <<script doesn’t understand the create quark message.
Stefen…it is past the hump now…yay…we got past the variable not found…That spelling stuff will get me every time…
I think now, I have script overload…Santa earlier wrote a part to force the computer to bypass the image missing dialog box… but since it is still asking me to pick something in the beginning, I think it is getting confused…in any case, It starts to go, but I get this error after I pick a destination now:
NSReceiverEvaluationScripError:4
here’s were I am at…I feel so close…
on open fileList
set deskPath to path to desktop as Unicode text
set destinationPath to (choose folder) as Unicode text
tell application "Finder"
repeat with i from 1 to count of items of fileList
set theFile to item i of fileList
set fileName to name of theFile
if not ((kind of theFile starts with "Quark") or (kind of theFile starts with "InDesign")) then
display dialog "This file is not an InDesign or Quark document!" buttons "Skipping" default button "Skipping" with icon 0 giving up after 6
return
end if
--Determine whether to use InDesign subroutines or Quark subroutines
if (kind of theFile starts with "InDesign") then -- Process as InDesign
my createInDesignPDF(theFile, deskPath, (text 1 thru -6 of fileName))
else -- Process as Quark
my createQuarkPDF(theFile, deskPath, (text 1 thru -6 of fileName))
end if
end repeat
end tell
end open
on createInDesignPDF(theFile, savePath, docName)
tell application "Adobe InDesign CS3"
open theFile
set theProps to properties of PDF export preset "[Press Quality]"
set newProps to {view PDF:true, crop marks:false, bleed marks:false, color bars:false, registration marks:false} & theProps
set oldProps to properties of PDF export preferences
set properties of PDF export preferences to newProps
export front document format PDF type to (savePath & docName & ".pdf") without showing options
set properties of PDF export preferences to oldProps
close front document saving no
end tell
end createInDesignPDF
on createQuarkPDF(theFile)
set deskPath to path to desktop as Unicode text
set PathToFolder to POSIX path of (deskPath & "Barbaras folder:inside folder") -- Set this to path to your folder
tell application "QuarkXPress"
--open theFile remap fonts no with Suppress All Warnings
activate application
end tell
tell application "QuarkXPress"
activate
tell application "System Events" to tell process "QuarkXPress"
click menu item "Layout as PDF..." of menu 1 of menu item "Export" of menu 1 of menu bar item "File" of menu bar 1
keystroke "G" using {shift down, command down}
delay 1
keystroke PathToFolder
delay 1
click button "Go" of sheet 1 of window "Export as PDF"
click button "Save" of window "Export as PDF"
delay 1
end tell
activate
tell application "System Events" to tell process "QuarkXPress"
try
if exists button "OK" of window 1 then
click button "OK" of window 1
end if
end try
end tell
end tell
tell application "QuarkXPress"
activate
close front document saving no
end tell
end createQuarkPDF
The Quark part cannot work because 3 parameters will passed but only one parameter is expected in the handler.
I don’t have Quark at all but I can’t immagine that you could script the PDF export only with this ugly GUI scripting.
on createQuarkPDF(theFile, savePath, docName)
tell application "QuarkXPress"
activate
export document 1 in (savePath & "Barbaras folder:inside folder:" & docName & ".pdf" as PDF output style "PDF CMYK"
close front document saving no
end tell
end createQuarkPDF
really stupid question…
I assume, that I need a folder on my desktop called barbara Folder and that the colon means to put it inside that folder?
Or, so I need to have a folder inside Barbara Folder called inside folder?
never saw that before so I am just making sure I have everything in place correctly.
thanks
barbara
hey there,
am I replacing that line, but nothing…I assume it is something in this block I am replacing your line with??
tell application "System Events" to tell process "QuarkXPress"
click menu item "Layout as PDF..." of menu 1 of menu item "Export" of menu 1 of menu bar item "File" of menu bar 1
keystroke "G" using {shift down, command down}
delay 1
keystroke PathToFolder
delay 1
click button "Go" of sheet 1 of window "Export as PDF"
click button "Save" of window "Export as PDF"
delay 1
end tell
on createQuarkPDF(theFile)
set deskPath to path to desktop as Unicode text
set PathToFolder to POSIX path of (deskPath & "Barbaras folder:inside folder") -- Set this to path to your folder
tell application "QuarkXPress"
--open theFile remap fonts no with Suppress All Warnings
activate application
end tell
tell application "QuarkXPress"
activate
tell application "System Events" to tell process "QuarkXPress"
click menu item "Layout as PDF..." of menu 1 of menu item "Export" of menu 1 of menu bar item "File" of menu bar 1
keystroke "G" using {shift down, command down}
delay 1
keystroke PathToFolder
delay 1
click button "Go" of sheet 1 of window "Export as PDF"
click button "Save" of window "Export as PDF"
delay 1
end tell
activate
tell application "System Events" to tell process "QuarkXPress"
try
if exists button "OK" of window 1 then
click button "OK" of window 1
end if
end try
end tell
end tell
tell application "QuarkXPress"
activate
close front document saving no
end tell
end createQuarkPDF
with
on createQuarkPDF(theFile, savePath, docName)
tell application "QuarkXPress"
activate
export document 1 in (savePath & docName & ".pdf") as PDF
close front document saving no
end tell
end createQuarkPDF
on createQuarkPDF(theFile, savePath, docName)
tell application "QuarkXPress"
activate
export document 1 in (savePath & docName & ".pdf") as PDF
close front document saving no
end tell
end createQuarkPDF
.
my createInDesignPDF(theFile, deskPath, (text 1 thru -6 of fileName))
else -- Process as Quark
my createQuarkPDF(theFile)
end if
.
with
.
my createInDesignPDF(theFile, deskPath, (text 1 thru -6 of fileName))
else -- Process as Quark
my createQuarkPDF(theFile, deskPath, (text 1 thru -5 of fileName))
end if
.
if the Quark extension is not “qxd” or longer or shorter than 3 characters, you have to adjust the -5 (length of extension -2)
Sorry, I can’t test anything.
The variable savePath is passed as a parameter, so it will be defined during the handler call.
Can you open the Quark AppleScript dictionary in Script Editor and check whether the export command is the same as displayed in the link above.
I suspect it isn’t
hey Stefen,
here is the export options in the dictionary:
export‚v : Export Layout as PDF
export reference : the object to save
in alias : the file in which to save the object
as string : the filter name or type for translating the data (as PDF)
[page range Unicode text] : pages to be exported: Default is All
[PDF output style Unicode text] : Output style to be used: Default is Captured Settings
I have actually been trying to go back and backtrack where I was earlier and have been trying to pice together each part that seems to get me closer.
I am getting lots of these errors thought, even now with older ones that were working:
NSReceiverEvaluationScripError:4
any idea what could be causing those. Mark thought it might be my assistive device not on, but it is not that.
what else could cause these…do you know?
You are right, I was testing some with and without the GUI…
Trying to mix and match some things to get it to work ;-(
I want to try and get it back to where I don’t have that error and start again with choosing the folder and ignoring the dialog box for missing images.
I think the problem is, there is no way to suppress the warning without GUI??? I think, at least from what i can see in the dictionary. There is a suppress on the open command, which will kill the font and profile questions, but nothing to kill the images are missing dialog after the export is chosen in the
script. I don’t know if I can get away without the GUI…
If you think of anything that would be great, if not, I cannot thank you enough for your time…
Thanks
babs
I have to say…for someone who doesn’t know quark…you did a great job of getting me over some hurdles here…
I learn a lot from you…
Don’t worry…I will be back to bug you with something else before you know it