Karstyn Posted March 16, 2011 Posted March 16, 2011 OSX 10.6 - FMPA 11v2 - ScriptMaster 4.122 IIf I use the Run Shell Script test in ScriptMaster DB, I do get the results displayed, but when in a script using a Set Variable [( Run Shell Script ( "my shell script" ; true ; 30 )] my results are "Executed shell command: my shell script". Not sure what I'm missing between the SM demo file and my script step? The actual shell script is checking if a file is locked by being open in another application. So I'm first using Select File get the file path, then creating a script variable of the shell script with the path embedded. The final shell script looks like this: fuser /Users/me/Desktop/test.xlsx | awk -F: '{print $NF}' This should return a pair of numbers if the file is locked and a single number if it is not locked. Again, if I copy the shell script into the SM demo file it works great, but I don't get the same results when setting either a variable or a field.
Smef Posted March 16, 2011 Posted March 16, 2011 can you post your script here? The result you're getting doesn't sound like something the module would return, so I suspect that something else in your script may be setting that message that you are receiving.
Karstyn Posted March 16, 2011 Author Posted March 16, 2011 Sure, here is the script after I have loaded both the SelectFile and RunShellScript functions: # Select file to test and create shell script Set Variable [ $MySelectedFile; Value:SelectFile ] Set Variable [ $script; Value:"fuser " & $MySelectedFile & " | awk -F: '{print $NF}'" ] # # Run shell script Set Variable [ $runScript; Value:RunShellScript ( $script ; True; 30 ) ] # Exit Script [ ] The value in $runScript ends up being "Executed shell command: fuser /Users/me/Desktop/test.xlsx | awk -F: '{print $NF}'"
Karstyn Posted March 16, 2011 Author Posted March 16, 2011 Looking at the RunShellScript code it looks like the results I'm getting are when the waitForOutput has been set to false. I've tried quoting the true parameter, and using 1 instead of true - no difference. I'm sure I'm missing something simple, just not sure what that is!
Smef Posted March 16, 2011 Posted March 16, 2011 Your True should be "true" (lower case t) and put in quotes so that it is passed as a literal string.
Karstyn Posted March 16, 2011 Author Posted March 16, 2011 OK - now I feel really stupid! I know I have tried using "true" a number of times, but now it's working. I guess it just needed your blessing! Thank you (for the obvious, or what should have been)!
Recommended Posts
This topic is 5012 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now