April 27, 201312 yr 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
April 27, 201312 yr 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"
April 27, 201312 yr 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.
April 27, 201312 yr 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??
April 27, 201312 yr 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.
April 28, 201312 yr 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