Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script that opens a pdf

Featured Replies

  • Newbies

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.

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

  • Author
  • Newbies

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.

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.

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.

  • Author
  • Newbies

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.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.