Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to save the output of a command in a variable, i.e:

Run Shell Script

Set Value of Variable

This has suddenly stopped working because the output from the shell script is no longer plain text:

(
    "<NSAppleEventDescripto [ 'utxt'(\"M:/titles/synonyms/PDFs/correx-2011-11-18\") ]>"

)

I don't understand why this is, since other shell scripts are still working fine. How to I make the shell script return plain text as it used to? Or, how do I make it into plain text so it can be saved in "Set Value of Variable"?

I guess an alternative solution might be to use AppleScript to run the shell command, though that doesn't solve the original problem.

How to recreate in Automator: 1. Get Specified Text: "M:/titles/synonyms/PDFs/correx-2011-11-18" 2. Set Value of Variable: create a new variable. 3. Run Shell Script: "sed -Ee 's/.:(.*)/\1/g' | sed -Ee 's/\///g'" to /bin/bash, stdin

When you run Automator, the results of the shell command MAY be in the NSAppleEventDescripto format. If they are, disabling "Set Value of Variable", running, then renabling and running again seems to fix it.

share|improve this question
1  
More information needed. Can you post the whole script? What is the command? What do you expect as the result? –  afragen Jan 17 '12 at 23:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.