Jump to content

How can I set a filemaker 7 field with applescript variable?


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

Recommended Posts

I have an applescript that extracts some file info from a file, and sets a variable with it. Now I want to enter that variable value into a filemaker field. How can I do this??

Here's the code:

set this_file to choose file

try

tell application "Image Events"

launch

-- open the image file

set this_image to open this_file

-- extract the property value

copy the dimensions of this_image to {xres, yres}

copy the name of this_file to originalname

-- purge the open image data

close this_image

end tell

display dialog "The file " & (originalname as string) & " Resolution is " & (((xres as string) & " by " & yres as string) & " pixels")

on error error_message

display dialog error_message

end try

I want to enter "originalname" and "xres" and "yres" values into filemaker fields. How can I do this?

Thanks.

Link to comment
Share on other sites

I figured it out! The key is the applescript must communicate to Filemaker via Applescript!

Here's the code that works:

set this_file to choose file

try

tell application "Image Events"

launch

-- open the image file

set this_image to open this_file

-- extract the property value

copy the dimensions of this_image to {xres, yres}

copy the name of this_file to originalname

-- purge the open image data

close this_image

end tell

tell application "FileMaker Pro"

activate

set field "Original Filename" in current record to originalname as string

end tell

on error error_message

display dialog error_message

end try

Hope this helps someone!

Link to comment
Share on other sites

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