Can't add "Run Shell Script" in Automator

When I drag "Run Shell Script" to the right pane in Automator nothing happens. All other applications I've tried can be dragged to the right pane. In the system.log I can find the following message:
Feb  7 16:56:48 Bananaboat Automator[195]: Error : -[AMWorkflowView _addAction:Kör kommandotolksskript] : * -[NSTextView replaceCharactersInRange:withString:]: nil NSString given.
"Kör kommandotolksskript" is "Run Shell Script" in Swedish.
Any ideas how to fix this?

You might have a corrupted file in the action, in which case you could reload it with something like Pacifist. You can't get the digest of a directory, so for comparison, compressing a copy of /System/Library/Automator/Run Shell Script.action on my desktop gives me the following:
sha1 digest: c209b69777f6a3301d72ddf0eb0ad4e7d4230741
md5 digest: 09e4ade9056ada3294ffb93bd16de1a7

Similar Messages

  • Cannot add "Run shell script" to workflow

    Just like the subject says on an iBook G4, OS X 10.4.8. The previous solution of deleting the Automator cache file in ~/Library did not work for me. The console log does show an error when I attempt to drag Run Shell Script to the workflow error:
    2006-11-25 21:15:32.909 Automator[545] * -[NSTextView replaceCharactersInRange:withString:]: nil NSString given.
    I do have an updated bash installed using DarwinPorts, however that is installed to /opt/local/bin, which appears in my path before /usr/bin. This isn't causing problems on my cube, though.
    Any ideas?

    You might have a corrupted file in the action, in which case you could reload it with something like Pacifist. You can't get the digest of a directory, so for comparison, compressing a copy of /System/Library/Automator/Run Shell Script.action on my desktop gives me the following:
    sha1 digest: c209b69777f6a3301d72ddf0eb0ad4e7d4230741
    md5 digest: 09e4ade9056ada3294ffb93bd16de1a7

  • Trouble using Run Shell Script with python in Automator

    Hi. I have a python script I want to run in Automator (update_puzzles.py). All it does is check, rearrange and update files and there is not supposed to be any input. I can get the script to run outside of Automator, in Terminal, by navigating to the right directory and typing "python update_puzzles.py"
    I must not be setting up Run Shell Script correctly. I have it set to /bin/bash and Pass Input to stdin. The command line simply reads python /pathname/update_puzzles.py (where pathname is the path to the .py file, which I got by dragging the file onto the Run Shell Script command window). There are no actions before this in my workflow and the action after is View Results.
    The log says Run Shell Script failed, and the error is "Traceback (most recent call last):"
    Any suggestions?
    Thanks so much.

    If the script is expecting to do stuff with files in the same directory as the executable, you will probably need to add a statement to change to the appropriate working directory. The shell used in the Automator *Run Shell Script* action is a generic one that does not share any of the environment variables that the Terminal uses.

  • Can't enter shell scripts in Automator?

    When adding the "Run Shell Script" action to a workflow in Automator, I can't actually type anything in the text box -- when I try to type something, I just get a bunch of seemingly random characters. Does anyone else see the same behaviour or is there just something funky going on with my two Macs?
    I'm certain I'd be able to create a couple of services for encrypting/decrypting messages in Mail with GPG, if only I could actually type the shell script into Automator

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • In Automator, how can I pass a shell script output to Display Notification?

    In Automator, how can I pass a Run shell script output to Display Notification?

    Soemthing like this will work

  • Automator runs shell script differently

    hi
    i build a little shell script that mounts my network-shares when they are available - that's works perfect if run by terminal but if i run it via Automator-Run shell script it does ******** - it doesn't seem to recognize my variables and creates dirs like $“Data“  instead of just Data
    can anyone help me with that?
    #!/bin/bash
    # connects to network shares if server available
    #config - wich server and mountpoints, login
    server=$"192.168.2.1"
    serverName=$"NAS(AFP)"
    dir=$“Data“
    dir2=$“Data1“
    login=$“xxx“
    pw=$“xxx“
    #connect-test and create mountfolders
    ping -q -c3 $server > /dev/null
    if [ $? -eq 0 ];then
      if [ -d "/Volumes/"$dir"" ]; then
      echo "folder $dir exists"
      else
      echo "creating folder $dir"
      mkdir "/Volumes/"$dir""
      fi
      if [ -d "/Volumes/"$dir2"" ]; then
      echo "folder $dir2 exists"
      else
      echo "creating folder $dir2"
      mkdir "/Volumes/"$dir2""
      fi
    #mount
      mount_afp "afp://"$login":"$pw"@"$serverName"._afpovertcp._tcp.local/"$dir"" "/Volumes/"$dir""
      mount_afp "afp://"$login":"$pw"@"$serverName"._afpovertcp._tcp.local/"$dir2"" "/Volumes/"$dir2""
      echo „ping ok“
    else
      echo „failed to connect to $serverName“
    fi

    FYI.  If you create an Alias of a mounted volume, the Alias will record all the connection information, except the password.  If your keychain is not locked, then when double clicking on the Alias, it will get the password from the keychain and mount the networked volumes (assumes you allowed the password to be stored in the keychain when you first mounted the volumes interactively).
    The Aliases can be put into your System Preferences -> Users & Groups -> Startup Items if you like.
    If this is a laptop and you are re-mounting the volumes when you get to a specific location, you might want to look at ControlPlane
    <http://www.macupdate.com/app/mac/39644/controlplane>

  • Automator - Run Shell Script - Does not return when script launches firefox

    Automator does not work the same on my MacBooks as my Mac mini! Both are latest Snow Leopard. I'm trying to automatically setup my MacBook after it decides if I'm at work, or elsewhere.
    The Automator Action "Run Shell Script" (Shell: /usr/bin/perl) does NOT return control when attempting to launch Firefox:
    system("/Application/Firefix.app/Contents/MacOS/firefox-bin -private news.google.com &");
    Note: the ampersand should cause Firefox to start as a background process.
    It only returns control after I close Firefox. I have a "Show Growl Notification" as the second action, so I know that the first action has not completed. Odd thing is that this works on my Mac mini. I also noticed that another difference: on my MacBook status is displayed in the top toolbar when the Automator application is running.
    Any ideas?

    Thanks, it worked. I forgot about stderr and stdin.
    I'm using Perl as it is part of a bigger script. I can quickly and easily figure out if I am at work where my MacBook is plugged into a network:
    my $ethernet = qx(ifconfig en0) =~ m{status:.active}xms;
    if ($ethernet) {
    # setup stuff for work environment
    } else {
    # setup stuff for mobile environment
    }

  • Apple Automator - Run Shell Script Application

    Morning, hope somebody can point of my error please.
    I'm attempting to create an Application wrapper for a minecraft server.
    I've done the following
    Automator > Application
    I've dragged in 'Run Shell Script'
    The Shell dropdown is '/bin/bash'
    The Pass input is 'as arguments'
    In the script I have '
    cd /Volumes/3Tb/Bukkit_live
    /usr/bin/java -Xmx2G -jar /Volumes/3Tb/Bukkit_live/minecraft_server.jar nogui
    Now when I run it through the automator app, it works fine, the server starts, however when I try and run it as a standalone application it does nothing ?
    Please help.
    Thanks in advance.
    Darren

    Best guess is that there is an environment variable in your Terminal session that does not exist when you are running an Automator workflow.
    You could try running an Automator workflow that does Run Shell Script with something like
    ( pwd
      id -a
      echo $#
      echo "$@"
      printenv
    ) >/tmp/automator.environment.txt
    Then do 2 things.  Run it within Automator and copy the /tmp/automator.environment.txt file someplace safe.  Next save it as an Automator app and run it that way.  Compare the 2 automator.environment.txt files and see if anything significant is different between the 2.
    This is just a guess (an educated guess, as this sort of thing has happened to others in the past when they see a difference between running a script interactively and running it as an embedded app).

  • Pass multiple Automator variables to Run Shell Script?

    I have two Automator variables I'd like to pass to Run Shell Script. I'm missing something obvious, but how is this done?
    Thanks in advance

    i don't know a nice way to do it but in general any input passed to a shell script will be stored in $@ if input is passed as arguments.
    in particular, if you stack two "get value of variable actions" one after another and follow it by "run shell script" both variables will be stored in $@ as a list. just try it out with the default
    for f in "$@"
    do
    echo "$f"
    done
    You'll see that both variables will be echoed.

  • Automator and "Run Shell Script" error

    First, if I'm in the wrong place with this- sorry. Figured this was an OS kind-of thing.
    I recently migrated to a new iMac ... I brought along an Automator script; I've been using it for years to perform a little rsync backup to an USB HDD. It's 'never' given me any problems ... until now!
    "*Run Shell Script*" encountered an error .. but alas, the system log is devoid of messages ... and the verbose log I have running indicates that all the files are copied/backed-up ... I would love any input on this that might help me get back on the feet. .....
    *Here's what my Shell Script Looks like:*
    Shell Option: /bin/bash
    Pass Input: to stdin
    rm -dfr '/Volumes/Backup HD/*********'
    rm -dfr '/Users/***********/Library/Logs/Profile_Backup.log'
    rsync -rltv /Users/******** '/Volumes/Backup HD/' > /Users/*******/Library/Logs/Profile_Backup.log
    (I'm sure there's way to only sync the changed stuff between backups ... but I've simply preferred the fresh copy approach).
    *I do however note this in my logs when I open Automator:*
    12/14/10 3:15:46 PM [0x0-0x42042].com.apple.automator.Backup[464] Application Stub: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

    @Tony T1
    Thanks, I'll certainly adjust the log file as suggested
    In troubleshooting the problem I went the terminal route - and issued each command ... during the rsync process I was getting an error ... turns out when it was syncing the SyncServices folder it was encountering a copy of the keychain ... which had root permissions - naturally rsync was not able to copy the file (personally I have no idea why the keychain would be being sync'd with anything)!
    I removed the file from the sync ... I'm still doing some "debugging" to correct the problem-
    Again, thanks for the assist!

  • Perl's __END__ doesn't work under Automator's Run Shell Script action

    Howdy,
    I have a large embedded data file in my Perl source file using the _END_ token. It works great at the command line, but when I copy and paste my Perl code into the Run Shell Script code window and execute it, reading the special file handle DATA always returns 0 lines.
    Help?
    -Eric

    Originally I was using $@ to parse a string and get the result pasted by the service. That was a while ago. There, I noticed that some Japanese characters were messed up. Basically all the kana characters that come with voicing markers like が-ga (instead of か-ka) etc. I did not have the time to pursue that issue though.
    Then, last night, I found that a colleague of mine had tried to use $@ to feed to a local dictionary application called ding (http://ftp.tu-chemnitz.de/pub/Local/urz/ding/). His problem was with characters that had umlauts. After verifying how he wrote his action I remembered that I had similar issues with Japanese.
    Basically his command was "/path/to/ding $@"
    That's supposed to use the selected string as an argument to pass to ding, which will launch a Wish application where the string is used as the searched item.
    From Terminal, that works a treat. But the exact same line in Automator (with input as argument, not as stdin) messed the composition and the resulting string was not recognized by ding as a match to what it was supposed to match.
    So, I tried a few things to get to the core of the issue and found that a simple "echo [accented characters]" was enough to reproduce the difference in string handling between Automator and Terminal. That difference is also reproduced on a number of person's machines.
    I have a number of services that basically revolve on "run shell script" actions and involve 3rd party application outputs, preference files etc. so it would not be convenient to show that to you.
    I have sent a mail about this issue to the automator list yesterday too:
    http://lists.apple.com/archives/Automator-users/2011/Jun/msg00004.html

  • How to prevent Automator's "run shell script" to create fully decomposed forms of my strings ?

    I am using Automator's "run shell script" and I am seeing that it outputs fully decomposed forms of my strings.
    For example, when I set the action to "echo été" in a service (with "Replace selected text" activated) and run that into a Textwrangler window, I'll get fully decomposed forms that Textwrangler won't understand. But when I simply type that command into Terminal, I get my string in composed form.
    The problem is not the display issue, but the fact that if I want to run grep for example in "run shell script", I will not be able to find the proper strings since the forms are different.

    Originally I was using $@ to parse a string and get the result pasted by the service. That was a while ago. There, I noticed that some Japanese characters were messed up. Basically all the kana characters that come with voicing markers like が-ga (instead of か-ka) etc. I did not have the time to pursue that issue though.
    Then, last night, I found that a colleague of mine had tried to use $@ to feed to a local dictionary application called ding (http://ftp.tu-chemnitz.de/pub/Local/urz/ding/). His problem was with characters that had umlauts. After verifying how he wrote his action I remembered that I had similar issues with Japanese.
    Basically his command was "/path/to/ding $@"
    That's supposed to use the selected string as an argument to pass to ding, which will launch a Wish application where the string is used as the searched item.
    From Terminal, that works a treat. But the exact same line in Automator (with input as argument, not as stdin) messed the composition and the resulting string was not recognized by ding as a match to what it was supposed to match.
    So, I tried a few things to get to the core of the issue and found that a simple "echo [accented characters]" was enough to reproduce the difference in string handling between Automator and Terminal. That difference is also reproduced on a number of person's machines.
    I have a number of services that basically revolve on "run shell script" actions and involve 3rd party application outputs, preference files etc. so it would not be convenient to show that to you.
    I have sent a mail about this issue to the automator list yesterday too:
    http://lists.apple.com/archives/Automator-users/2011/Jun/msg00004.html

  • Run Shell Script: Interaction?

    I use a shell script to build and edit blog articles.
    It's quite clever when on the local server where the files end up. A simple routine of building a .php file, then it launches Vim on the file it created, I make some edits to it (add the content), then save and exit Vim.
    That is it. When done on the local server, this is perfect. However, with my new upgrade to Tiger, I wanted to try using Automator to do some of this as well as the image copy and conversions which I typically do beforehand.
    The Workflow I have so far actually works but the SCRIPT part is messing with me.
    I need to have Automator launch the script in a Terminal window so I can interact with the steps it goes thru. Essentially, the launch of Vim in the Terminal opening the file that was made.
    I can't figure out how to do this. Terminal is not an app in the left pane of Automator, and when I call my script using "Run Shell Script", it does not perform the last step, "vi filename.php" - rather it completes and leaves my "Stencil" un-edited.
    How can I get this done?
    Beavis2084

    http://discussions.apple.com/message.jspa?messageID=1791477#1791477

  • Run Python Script in Automator

    I have a python script (which was written for me), and I would like to make it so that the script executes every x minutes. I know this should be simple to do, but I can't figure it out.
    Thus far, I have created a workflow in automator, used the "Run Shell Script" action, and pasted the script into the text field.
    "Workflow failed - 1 error
    I'm very new to this, so I'm sure it's a simple error. Any help would great.
    Here is the script I am trying to execute.
    #!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
    # you can change the above line to point to the location of python
    # on your system (you can check this by typing 'which python' into
    # Terminal.app), but this isn't necessary if you execute the script
    # using "python ksl.py [URL]"
    # change the value of NAME to your desired name
    NAME = "Bob Jones"
    # change the value of EMAIL to your desired email
    EMAIL = "[email protected]"
    # your message will be the contact name as mined from the page source,
    # followed by whatever message you enter between the following triple quotes
    MESSAGE = """Replace this text with your message. Newlines are also OK."""
    import mechanize
    import re
    import sys
    def setupBrowser(url):
    b = mechanize.Browser()
    # b.sethandlerobots(False)
    # b.addheaders = [('User-agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows XP)')]
    try:
    b.open(url)
    except mechanize._mechanize.BrowserStateError:
    print >> sys.stderr, "You have mistyped the URL. It must by in the following format, including the quotes and the preceding 'http://':\n\t %s [--test] 'http://www.blah.com'" % (sys.argv[0])
    sys.exit(1)
    return b
    def grabLinks(b):
    """Takes in a mechanize.Browser() object pointed to a listings URL and returns a listing of classified ad links."""
    links = []
    for link in b.links():
    # change this line if the URL format ever changes
    if re.search(r'&ad=', link.url):
    links.append(mechanize.urljoin(link.base_url, link.url))
    return links
    if _name_ == '_main_':
    # check for proper command line args
    if len(sys.argv) != 2 and len(sys.argv) != 3:
    print >> sys.stderr, "Usage: %s [--test] url" % (sys.argv[0])
    sys.exit(1)
    args = sys.argv[1:]
    if len(args) == 1:
    # start from listings page
    url = args[0]
    # set up the mechanize browser object
    b = setupBrowser(url)
    # grab only the relevant ad links
    links = grabLinks(b)
    if not links or len(links) == 0:
    # the links do not follow the same format as the original page
    print >> sys.stderr, "The link format has changed, or you have mistyped the URL."
    sys.exit(1)
    # open the first link on the listings page
    b.open(links[0])
    else:
    # start from a single listing
    if args[0] != "--test":
    print >> sys.stderr, "Usage %s [--test] url"
    sys.exit(1)
    url = args[1]
    b = setupBrowser(url)
    # grab the HTML so that we can search for the contact name
    response = b.response().get_data()
    # perform a regex search on the HTML for the contact name
    regexSearch = re.search(r'Contact Name:\s*\s(w+)s', response)
    contactName = ""
    if regexSearch:
    # contact name found -- store it
    contactName = regexSearch.group(1)
    else:
    # contact name not found -- use generic greeting
    contactName = "Hello"
    theOne = ""
    # find the "Email Seller" link (stored as "theOne")
    for link in b.links():
    # again, if the URL changes, change this line
    if re.search(r'xmldb=', link.url):
    theOne = mechanize.urljoin(link.base_url, link.url)
    if theOne == "":
    # something went wrong
    print >> sys.stderr, "'Email Seller' link has changed formats within the HTML."
    sys.exit(1)
    b.open(theOne)
    # fill out the forms. note that I am grabbing the SECOND form here.
    # again, this might change over time, so feel free to change this from
    # nr=1 to nr=0 (for the first form), nr=2 (for the third form), etc.
    b.select_form(nr=1)
    b['form_4'] = NAME
    b['form_5'] = EMAIL
    # append the contact name to the rest of the message
    MESSAGE = contactName + """,\n\n""" + MESSAGE
    b['form_6'] = MESSAGE
    # submit the form
    b.submit()
    b.close()

    If the script works, and all you need is to execute every x minutes, use launchd, and its simple to write with the Lingon GUI: http://sourceforge.net/projects/lingon/files/

  • Can fljs launch a shell script?

    I'm stuck on trying to figure out a long process (as flash does not allow to publish from the terminal (hint, hint adobeDev people).
    How can I launch a shell script after a *.fljs has published the a swf file, so it can push the swf file further down the process?

    As has been mentioned, you can run Applescript. You would use:
    do shell script "/path/to/your/shell/script"
    You could also write an Automator app, and use the "Run Shell Script" action.
    NOTE: Make sure the environment running from iCal is sufficient for your needs. You might want to do a test run with the following commands to see what your environment is:
    ( id -a # user id
    echo "$#" # number of arguments passed
    echo "$@" # all the arguments passed
    pwd # your current working directory
    printenv # your environment variables
    ) >/tmp/iCal.bash.script.env.txt

Maybe you are looking for