Jump to content

File paths, container fields and applescript


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

Recommended Posts

Hallo

I'm trying to automate the process of inserting word documents into container fields (reference only) using applescript and I'm missing something.

If I use

set file_path to (choose file) as string

and later

set the cell "Pathname" to file_path

the container holds the pathname as a string and wont launch the file on manual entry/ double click to the field

If I use

set file_path to (choose file)

or

set file_path to (choose file) as alias

Then later

Applescript "Gets an error.. Filemaker cant set ...etc etc"

Any thoughts or assistance greatly appreciated.

Thanks

Simon

Link to comment
Share on other sites

AppleScript and FileMaker are telling you the truth. You can't Insert File with AppleScript, as far as I know. You have to copy or move the file to a fixed location and name, where FileMaker can then Insert File, using its fixed File Reference.

This is a modified version of an earlier file I posted, which first zipped the file before using Insert File. This one just Inserts it as is. It uses the Unix "ditto" command (which can also zip it) to copy the file to the "temporary items" folder (where it is later deleted).

Warning: If you have file on the desktop with the same name as the file name in the FileMaker field, exporting will replace it, with no warning, and no change of modification date; such as an updated version of the inserted file. Gone forever. One could write a warning I suppose. But I must go make coffee now :-]

InsertFileTI.zip

Link to comment
Share on other sites

This topic is 6958 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.