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

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

Recommended Posts

  • Newbies
Posted

I am trying to create a script that does the following

1) copies a serial number contained in a field in a FMP table

2) opens spotlight, pastes the copied serial number and searches for that serial number (which is the name of a pdf file

3) opens the top hit in spotlight which will be the pdf file

I assume I need to use either Applescript or Automator to get this done. I have played around with it with no luck. Any help would be appreciated. Thanks.

Posted

Why not just store a ref to the pdf in the respective FM record and open it from there?

  • Newbies
Posted

I thought of that, but I have over 5000 pdf's that I would need to insert into a container field. I thought using spotlight to find the pdf might be less work. I got a script working that finds a specific file. It is

tell application "Finder"

set the search_string to "46280"

end tell

tell application "System Events"

keystroke " " using {option down, command down}

delay 1

keystroke search_string

delay 1

end tell

What I want to do is instead of searching for "46280" I want to paste the contents of the clipboard into spotlight.

Posted

Oh, so this is catching up after the PDFs exist and they are scattered all over? Because if they're in one folder and named with a field value, then calc'ing the path and setting the reference is fairly straightforward.

I'm not an AppleScripter, so I'll leave this to someone else.

Posted

If they're in one folder and named consistently, then calculating the path is all it takes. No need for "setting the reference" or an Applescript.

  • Newbies
Posted

How would I set up the ref that you are referring to? I have all the files in about 20 different folders but I can easily put them all together. Thanks for the help.

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