Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6108 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I think I have found a way to get at my data for the header - export field contents - but can I append a file ---- write to the same file over and over - appending without overwriting ---- how do I do that?

Posted

Troi File plugin can do that, or possibly AppleScript.

Posted (edited)

Here is an example to prepend a line of text to a text file. It will create the file (on your desktop) if it does not yet exist; otherwise it will add the line at the beginning. You would get that line from a FileMaker field. I've written this so that it will work if you don't have FileMaker set up to do it yet. So, normally you'd run it within a FileMaker Perform AppleScript, but you can run it with Script Editor to see.


ttell application "FileMaker Pro Advanced"

	try

		set new_line to cell "New Line" of current record

	on error

		set new_line to "new line "

	end try

end tell

set file_spec to open for access file ((path to desktop as Unicode text) & "test_insert.txt") with write permission

try

	set txt to read file_spec

on error

	set txt to ""

end try

write (new_line & return & txt) to file_spec starting at 0

close access file_spec

Edited by Guest

This topic is 6108 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.