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

Attempting something simple proving to be very difficult


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

Recommended Posts

  • Newbies
Posted

Greetings all, long time reader, first time caller, etc.

I've been thinking of the best forum to put this post and it seemed like this is the one for my problem, since it involves extensive use of AppleScript. Perhaps I would get better visibility elsewhere on the board, but I figured why not start here and work from there.

In plain english, I'm trying to do the following:

1) select a special text file defined by user input

2) run a perl script that generates an .svg graphic based on that text file

3) insert the .svg into a filemaker image container (not as reference)

4) insert the text file path into a filemaker text field

5) delete the .svg

I recognize that this is a little tricky for multiple reasons. Here is the approach I've worked out so far.

tell application "FileMaker Pro"

set plasmidfile to (choose file with prompt "Select your plasmid:") as string

set "Map location" of current record to plasmidfile

end tell

tell application "Terminal"

perl /Users/joel_r/Documents/Scripts/ape2svg.pl -i plasmidfile

# this perl script generates an .svg file with the input file name at the beginning and .svg appended at the end

set picturefile to plasmidfile & ".svg"

end tell

tell application "FileMaker Pro" 

# i want filemaker to put the .svg into the container field (not as reference!)

# i want filemaker to put the path into the text field

end tell

# then i will ask applescript to delete the .svg 

As you can see, I'm having problems. Chasing around the internet hasn't helped me that much (some information is obsolete, some too technical for my understanding). So here I am, hat in hand, asking for assistance. Thanks in advance!!

  • 6 months later...
  • Newbies
Posted

Briefly and without testing but should get you on the right track

 

set plasmidfile to (choose file with prompt "Select your plasmid:") as string

tell application "FileMaker Pro"

go to yourdatabase

go to yourlayout

set cell "Map location" of current record to plasmidfile

end tell

tell application "Terminal"

 

perl /Users/joel_r/Documents/Scripts/ape2svg.pl -i plasmidfile
# this perl script generates an .svg file with the input file name at the beginning and .svg appended at the end
set picturefile to (plasmidfile & ".svg" as string)

end tell

tell application "FileMaker Pro"

go to yourdatabase

go to your layout

--create a filemaker script and reference it from applescript 

do script "your import picture into field script with store as reference unchecked"

set cell "path ref" of current record to picturefile

end tell

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