Edit to add:
I've just tried it by hardcoding the following in and it works so it looks like it's a 'slash direction' problem!
Is there any way to automate the task of changing from / to \ ?
Are you performing this script from a client machine or via a server schedule?
Are you sure that this file path is valid?
What OS are you using?
Is the shared directory to which this path points mounted/mapped and does the current user have "write" permission to write to this directory?
And some older versions of Filemaker may require that you use "file:\\SERVER\Documents\Folder"
and in windows, there'd need to be a drive letter there--one mapped to the current user's machine and whether you map the drive letter to Server or Documents
One trick for getting a correct file path is to insert a file from the desired location "by reference" into a container field and then you can extract a valid file path from the container field. THis thread has a download link for a file set up so that you need only insert a file from the desired location to see the file path to the file's location: Exploring the use of a $Path Variable in Scripts
From a client machine connected to the network as Admin with full read/write permissions.The filepath is valid (see above - I think it crossed over with you posting)...
Windows 7 / Filemaker 12
I'm sure it's just a slash direction issue!
I am attempting to do a similar thing but with a mac osx. I currently had the line below in my script which would export a record as a pdf and put the pdf into a file called "enquiries" that is located on my desktop. The pdf file is automatically named after the Enquiry name and order number - e.g. Smith/1000.pdf.
"file:" & Get (DesktopPath ) & "Enquiries" & "/" & Invoiceitems_INVOICEDETAILS::Enquiry_Name & "/" & Invoiceitems_INVOICEDETAILS::fk_Order & ".PDF"
However, Now I want to export this file to a folder in my documents folder on my new mac server and unsure how do do this. I have already implemented a way to create folders from FM12 to the server using applescript but am now stuck with implementing an export from a script...Help on this would be hugely appreciated as have already pulled out remaing hair overcoming the fodler creation on server issue!
You can use the substitute function to replace "\" with "/"
Substitute ( yourField ; "\\" ; "/" )
the extra \ is needed as \ functions as the "escape" character within quoted text and thus you need to "escape the escape character" to get it to be perceived as the backslash.
Worked like a dream that Phil!
Problem solved and all is good with the world once more ;-)
Thank you so much!