Newbies jdonahue Posted April 4, 2009 Newbies Posted April 4, 2009 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.
bcooney Posted April 4, 2009 Posted April 4, 2009 Why not just store a ref to the pdf in the respective FM record and open it from there?
Newbies jdonahue Posted April 4, 2009 Author Newbies Posted April 4, 2009 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.
bcooney Posted April 4, 2009 Posted April 4, 2009 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.
comment Posted April 4, 2009 Posted April 4, 2009 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 jdonahue Posted April 4, 2009 Author Newbies Posted April 4, 2009 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now