I’m so very close to finishing a script to create a hot folder for Distiller to pair with my other script (see http://macscripter.net/viewtopic.php?id=33648) but for some reason when I’m creating the POSIX path for the sourcePath variable, the script effectively “doubles” the path, so I get something like “File /Users/admin/Desktop/Web PDFs/2074/Users/admin/Desktop/Web PDFs/In/1000096.eps wasn’t found.”
The path should obviously be /Users/admin/Desktop/Web PDFs/In/1000096.eps
I can’t see where it’s picking up the extra path to the Process_Folder
set Process_Folder to (path to desktop as string) & "Web PDFs:" as alias
set EPS_Folder to (Process_Folder as string) & "In:" as alias
set PDF_Folder to (Process_Folder as string) & "Out:" as alias
set Logs_Folder to (Process_Folder as string) & "Logs:" as alias
-- Checks to see if Distiller is running, and if not, launches and hides it
tell application "System Events"
if not (exists process "Acrobat Distiller 7.0") then
launch application "Acrobat Distiller 7.0"
tell application "Acrobat Distiller 7.0"
set visible of front window to false
end tell
end if
end tell
--delay 15
-- creates object "fileList" which is a listing of all EPS files in the "In" folder
tell application "Finder"
set fileList to every file of folder EPS_Folder whose name extension is "eps"
set jobOptions to "/Library/Application Support/Adobe PDF/Settings/Smallest File Size.joboptions"
end tell
-- repeat should step through each file in folder
repeat with i in fileList
-- sets theFilePath to the name of the EPS file preceded by the path to it
set theFilePath to (EPS_Folder as string) & ":" & i
-- creates POSIX path of theFilePath to pass to Distiller
set distFile to POSIX path of theFilePath as alias
-- sends each file to Distiller, while setting the job options and output folder
tell application "Acrobat Distiller 7.0"
Distill sourcePath distFile destinationPath PDF_Folder adobePDFSettingsPath jobOptions
end tell
-- deletes EPS file after being sent to Distiller
tell application "Finder"
move i to trash
end tell
end repeat
-- Move any log files created by Distiller settings
tell application "Finder"
try
set Log_List to (files of (PDF_Folder as alias) whose name extension is "log") as alias list
on error -- only one file
set Log_List to (files of (PDF_Folder as alias) whose name extension is "log") as alias as list
end try
move Log_List to (Logs_Folder as alias)
end tell
Model: PowerMac G5 Dual 2.0
AppleScript: 1.10.7
Browser: Firefox 3.6.6
Operating System: Mac OS X (10.4)