Jump 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.

Need help creating a script that takes the user to a specific folder, similar to "Reveal in Finder"

Featured Replies

  • Newbies

I need help writing (or obtaining) a script that will, with a click of a button, take the user to a folder in the finder.

I'm using FileMaker Pro 17 on a Mac. I'm also illiterate when it comes to scripting. I know what I want it to do but I don't know how to do it.

Some background: The database I'm working with holds information and a video clip. I use it to quickly search keywords and to see the video clips in the results. What I'd like to have is a button next to the "VIRIN" number (field 2 from top left) that will take me to the folder that contains the original video clip. These clips are stored on an external SAN. The path will be the same for each group of clips, i.e. Tape # 2916 in the case below. As I change tapes, I will have to redirect the path.

Here is an image of the database. The second image below it is of the path to that specific record file. 

Again, I'm awful at scripting so I may be asking a lot. Thanks for any and all help. 

spacer.png

52622016455_12def07e1c_c.jpg

 

There are a couple of ways you could do that (Perform AppleScript, Open URL). Both require you to provide the path to the folder you wish to open. I suppose the path can be calculated from the data stored in the record, but you did not tell us how.

Once you have the formula to calculate the path it should be very simple. 

 

  • Author
  • Newbies

Thanks for the responses. 

I had to add the video clips via drag and drop. Not the best way to do it, but as I said before, I can't scripting. As for URL, these files are in a self-contained system that's not connected to the internet. AppleScript sounds right but I'm clueless.

 

  • Author
  • Newbies

I tried this as a test and it works for my local hard drive. Am I on the right track? I can't test the real path bc it's at work.

set targetFolder to POSIX file "/Users/krichey/desktop/test"

tell application "Finder"

open targetFolder

activate

end tell

8 hours ago, KRichey said:

As for URL, these files are in a self-contained system that's not connected to the internet.

The Open URL script step can open files (and folders) on your local system just as well. If you have a folder named "test" on your desktop, then:

Open URL [ "file://localhost/Users/krichey/Desktop/test" ]

will open it and bring it to front.

 

But again,  if not all clips are in the same folder, then the path to the folder needs to be calculated - whether you use Open URL or AppleScript. 

 

Edited by comment

  • Author
  • Newbies

You're absolutely right, the clips are not all in the same folder. Would you be willing to show me how to calculate it?

5 minutes ago, KRichey said:

Would you be willing to show me how to calculate it?

I don't know how to calculate it, because I don't know what do you have as the input/s to such calculation, nor what should the result be.

I can give you a hint how to determine the expected result: assuming you want to use AppleScript, run the following script in Script Editor:

tell application "Finder"
	set myfolder to (choose folder)
	POSIX path of myfolder
end tell

When prompted, select one of the folders on the external volume. The result will tell you what the POSIX path to the selected folder needs to look like.  Then you need to find a way to calculate such result from your data and pass it to your AppleScript. That's assuming your record has the necessary data to produce the result.

 

  • Author
  • Newbies

Thanks so much! I'll work with this.

Create an account or sign in to comment

Important Information

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

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.