The error message you are reporting simply means that the application could not create the file at the location specified. It could be due to a number of issues, but an invalid file path is the most common.
Can you post a detailed description of how you specify the file path and name when you use these two script steps to export or save?
Set Variable [$dirName; Value:"Data"]
Set Variable [$desktopUse; Value:Substitute ( "/" & Get ( DesktopPath ); [ "//" ; "" ]; [ "/" ; "\\" ])]
Send Event [open document/application; "cmd.exe /C MKDIR " & Quote ( $desktopUse & $dirName & "\\" )]
This way I create the folder on the desktop.
Export Records [ File Name:“file:Data/DataCu.csv”; Character Set:“Unicode (UTF-16)”; Field Order:Something::SomethingID Something::FieldName ]
[ No dialog]
Could you help me?
Can you confirm that the directory is created?
Will not be the file path to the data directory on your desktop unless the database file is also located on the desktop.
Since your runtime is likely located inside a runtime folder created by FileMaker advanced, this would result in an invalid filepath when the script is run from the file path.
Try this approach:
Set variable [$FilePath ; Value: Get (DesktopPath ) & "Data/DataCu.csv"]
Export Records [ $FilePath
Give me a moment to try it, OK?
PhilModJunk you are absolutely right! Your solution is working perfectly. Thank you very much.
Have a nice day, greetings from Greece.