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.

Change a filename before inserting in FM

Featured Replies

Hi all,

I've been trying all afternoon to get this to work but I'm finally ready to throw in the towel and ask for help on this one. Here's the scenario:

I need to insert files into a container in FM, but they need to have their names changed before I insert them. I have all my fields and variables holding the correct info but I can't get the AppleScript to work, This is what I've got so far..

"Tell application "  & Quote ( "Finder" ) & ¶ & 



"set name of file " & $filePath & " to " & $newFileName & ¶ & 



"end tell"

$filePath is called out with colons, like "Mac:users:me:NameOfFile.pdf"

$newFileName is called out like "ChangedNameOfFile.pdf"

(all sans quotations)

I'm certain it's my syntax in the AppleScript but I can't figure out where the problem lies.

Thanks in advance for any help offered!

Edited by Guest

A couple things. First, you're using the "local to this script only" syntax for your variables. Apparently they aren't available to the calculation, as it won't work. Use "$$" instead.

You also need to somehow get quote marks around your filepath and your file name, as they are text. This works:

"tell application " & Quote ( "Finder" ) & ¶ &

"set name of file " & Quote ($$filePath) & " to " & Quote ($$newFileName) & ¶ &

"end tell"

  • Author

That did it!

Many thanks, Fenton!

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.