Why does create a folder on my desktop and not to the folder path I have chosen earlier in the script. Does it have something to do with the fact that I’m trying to create a folder on the server?
Thanks Tim
tell application "Finder"
activate
if New_PDF_Name contains "v1" then
make new folder to folder_path with properties {name:new_filename}
set Save_As_name to folder_path & new_filename & New_PDF_Name
else
set Save_As_name to folder_path & New_PDF_Name
end if
tell application "Adobe InDesign CS3"
activate
tell doc_name
export format PDF type to Save_As_name using "Doctor LowRes PDF" without showing options
end tell
end tell
end tell
beep
display dialog "Your PDFs are Done" buttons {"Done"} default button 1
end tell
its at not to
make new folder at folder_path with properties {name:new_filename}
James, Thanks that how I originally had that line but I kept getting the error…
“Finder got an error: Can’t make class folder.”
The error went away if I changed it to “to” instead of “at”
Thanks Tim
Can you show the code where you are setting the value of folder_path?
Something has to be amiss there. How are you connected to the server? AFP, SMB, NFS, FTP? Something else?
Here is the whole script…
Thanks for the help its driving me crazy…
tell application "Adobe InDesign CS3"
activate
set doc_name to active document
set folder_path to (choose folder with prompt "Select folder to Save PDF files") as string
set the_filename to name of doc_name
set prevTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to "."
set new_name to text 1 through -6 of the_filename
set AppleScript's text item delimiters to "_"
set new_filename to text item 3 of new_name
set issue_number to text item 4 of new_name
set version_number to text item 5 of new_name
set AppleScript's text item delimiters to prevTIDs
set PDF_name to new_filename & "_" & issue_number & "_" & version_number & ".pdf"
set New_PDF_Name to text returned of (display dialog "Save PDF As" default answer PDF_name) as string
tell application "Finder"
activate
if New_PDF_Name contains "v1" then
make new folder to folder_path with properties {name:new_filename}
set Save_As_name to folder_path & New_PDF_Name
else
set Save_As_name to folder_path & New_PDF_Name
end if
tell application "Adobe InDesign CS3"
activate
tell doc_name
export format PDF type to Save_As_name using "Doctor LowRes PDF" without showing options
end tell
end tell
end tell
beep
display dialog "Your PDFs are Done" buttons {"Done"} default button 1
end tell
What OS? How are you connected to the Server? Are you sure you have permissions to write to the share?
yes I have full access to the server over the network, connect via built in ethernet
On OS X 10.4.10
I have full privileges
It doesn’t even work if I try to do it to a folder on my desktop
Hi,
make new folder expects a reference like file specifier or alias,
although a string path works also on local volumes.
.
make new folder at folder folder_path with properties {name:new_filename}
.
On a shared volume I recommend to use the shell to create the folder
.
set New_PDF_Name to text returned of (display dialog "Save PDF As" default answer PDF_name) as string
if New_PDF_Name contains "v1" then
do shell script "/bin/mkdir -p " & quoted form of (POSIX path of folder_path & new_filename)
end if
set Save_As_name to folder_path & New_PDF_Name
tell application "Adobe InDesign CS3"
.
Notes:
¢ this has no effect
set AppleScript's text item delimiters to "."
set new_name to text 1 through -6 of the_filename
text item delimiters affects only text items
¢ These nested application tell blocks are legal, but I would avoid them