I'm having some difficulty with the Save Records as PDF script step. I get an error: “XXXXXXXXX.pdf” could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk.
I've dug around on the net but haven't found anything that might help.
- I first capture the path in a variable, $Path.
CTS = Get ( CurrentTimeStamp ) ;
TS = Year ( CTS ) & Right ( "00" & Month ( CTS ) ; 2 ) & Right ( "00" & Day ( CTS ); 2 ) & Right ( "00" & Hour ( CTS ); 2 ) & Right ( "00" & Minute ( CTS ) ; 2 )
GetPath ( "Desktop" ; "Royalties_" & TS ) )
Where GetPath returns the path tot the Desktop and appentds the folder name of Royalties with a date and time stamp.
- Next I create the above folder and open the folder wide open with Perform AppleScript
"do shell script " & Quote ( "mkdir " & $Path & "; " & "chmod 777 " & $path )
- All works so far. Next I get the name for the file (where the name of the file is like LastName_FirstName and build a full path.
"FileMac:" & $Path & "/" & Substitute ( $Name ; ", " ; "_" ) & ".pdf"
- Finally, I try to save the file
Save Records as PDF [Restore; No dialog; "$file"; Records being browsed]
And this is where I get the error. The interesting thing is if I don't give it a full path and just give it the name of the file and nothing more, it creates the PDF just fine in the same folder as the solution is in. But I'll have a couple hundred of these files to create and I would like to keep them together and not polute the solution folder.
Any help would be appreciated.