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.

Featured Replies

  • Newbies

Okay...   I am trying to remove a file using a calculated Path.

 

Here is what I have so far.  I have gotten the below Shell Script to work.

 

 

"try¶
do shell script "rm -r /Users/en/desktop/dropbox/pip/Labels/FMFiles/Cable2.fmp12"¶
end try"

 

 

What I am trying to get working is the Path of the File automated.  The Filed below has the correct Path of the file.  I don't get any errors when this runs.  

 

 

try¶
do shell script "rm -r _MASTER::FilePath & 'Cable2.fmp12'"¶
end try"

 

Where am I going wrong?

 

Thanks,

 

ERIC

Try this. I have not tested it but it corrects some of the mistakes you made. The script assumes that _MASTER::FilePath ends with a "/".

 

You might want to take a look at the ScriptMaster plug-in. It is better suited for such tasks.

"try¶"
&    "do shell script "rm -r "
&    _MASTER::FilePath
&    "Cable2.fmp12"¶"
& "end try"

Here's a little trick...

 

You can export an empty container - this will delete the target file!!

 

Although the script will say "Container fields cannot be exported" the target file gets removed anyway.

  • Author
  • Newbies

 

Try this. I have not tested it but it corrects some of the mistakes you made. The script assumes that _MASTER::FilePath ends with a "/".

 

You might want to take a look at the ScriptMaster plug-in. It is better suited for such tasks.

"try¶"
&    "do shell script "rm -r "
&    _MASTER::FilePath
&    "Cable2.fmp12"¶"
& "end try"

 

Karsten,

 

I tried the above script and no go...    Any other ideas??

2 ideas:

 

- replace the '-r' with '-f' - you don't want to delete whole folders accidentally.

 

- make a script with 1 SetVar statement or a calculated result field  which contains just the code I posted first. Execute it in the context of the _MASTER table and post the result.

  • Author
  • Newbies

I found a solution.   I had played around with the ScriptMaster Plugin a while back and for reason couldn't get it to work. This time around the ScriptMaster worked.  I did have to set a Variable for the File Path.  

 

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.

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.