问题
With a great deal of help from @Chuck I have written this filemaker script which is supposed to find related PDF attachments in container fields and export them to a temporary folder then trigger an applescript which will open & print the documents using adobe acrobat.
Unfortunately the script will not work and although I have used script debugger and tried to follow advice I am still having difficulty. Any assistance in telling me exactly where I'm going wrong would be appreciated.
Go to Related Record [Show only related records; From table: “Attachments”; Using layout: “Attachements Report" (Attachments); New window]
Enter Find Mode []
Constrain Found Set [Restore]
Sort Records [Restore; No dialog]
#
#After finding the related attachments and constraining them to the specific type we rename and export them to the desktop
#
Go to Record/Request/Page [First]
Loop
Set Variable [SPath; Value:"fi|emac:" & Get ( TemporaryPath ) & Attachments::Record number &"-' & Attachment Type List 2::Prefix_z & Lien::Lien_lD_z]
Set Variable [SASPath; Valuei"/' & Substitute( SPath; "filemac:" & Cet( SystemDrive )1 )]
Set Field [Attachments::g_app|escript_parameter; $ASPath]
Export Field Contents [Attachments::file_c; “SPath"]
Perform AppleScript ['set _pdf_path to contents of cell "g_applescript_parameter" of current layout batchprint(_pdf_path) on batchprint(mycurrentfile) tell application ‘Adobe Acrobat Pro" activate —- bring up acrobat open alias mycurrentfile “'_*]
Go to Record/Request/Page [Next; Exit after last]
End Loop
Close Window [Current Window]
Using Script Debugger I get the following errors...
On Script Step, Export Field - Error: “ "(VARIABLE FILE NAME).. could not be created on this disk. use a different name make more room on the disk.
On Perform AppleScript Step: Error: Object not found & Error: Unknown Error: -1728
回答1:
Is this being executed on the server (via a schedule) or on the client computer?
Have you verified that the directory permissions are actually set correctly in the temporary path?
Have you tried using Get ( DocumentsPath )
instead of the temporary path, just to verify?
来源:https://stackoverflow.com/questions/24415065/fixing-a-filemaker-script-with-embeded-applescript-and-global-field