Creates an empty, closed data file, to then open with the Open Data File script step and add data to using the Write to Data File script step.
Creating a FileMaker Pro Advanced file
•Specify File is the path of the data file to create. See Creating file paths.
•Create folders specifies whether to create new folders if they don't exist in the specified path.
Product | Supported |
FileMaker Pro Advanced | Yes |
FileMaker Go | Yes |
FileMaker WebDirect | No |
FileMaker Server | Yes |
FileMaker Cloud products | Yes |
FileMaker Data API | No |
Custom Web Publishing | Yes |
Runtime solution | No |
FileMaker Pro 18.0 Advanced
•If the specified path can't be accessed or the file already exists, Get(LastError) returns 300 ("File is locked or in use"). See Get File Exists script step.
Creates an empty data file named data.txt if the path already exists.
Create Data File [ "data.txt" ; Create folders: Off ]
Checks whether a file named change.log exists in the Documents folder and, if it doesn't, creates the file. If the file can't be created, the script displays an error code.
Set Error Capture [ On ]
Set Variable [ $file ; Value: Get ( DocumentsPath ) & "change.log" ]
Get File Exists [ "$file" ; Target: $fileExists ]
If [ $fileExists ]
Show Custom Dialog [ $file & ": Already exists" ]
Exit Script [ Text Result: ]
End If
Create Data File [ "$file" ; Create folders: Off ]
Set Variable [ $error = Get ( LastError ) ]
If [ $error = 0 ]
Show Custom Dialog [ $file & ": Created" ]
Else
Show Custom Dialog [ $file & ": Not created. Error code: " & Get ( LastError) ]
End If