Torn Barb

Q: The "Tell" Command?

Why is my system showing the following:

line 1: tell: command not found

Is 'tell' a default function of Terminal/Shell or is it a third party?

Note: Trying to right some scripts by hand and I'm running across a lot of "....insert tell (here)..."

MacBookPro & Mac Mini, Mac OS X (10.6.5)

Posted on Apr 5, 2011 4:01 PM

Close

Q: The "Tell" Command?

  • All replies
  • Helpful answers

  • by Barney-15E,

    Barney-15E Barney-15E Apr 5, 2011 4:19 PM in response to Torn Barb
    Level 9 (50,767 points)
    Mac OS X
    Apr 5, 2011 4:19 PM in response to Torn Barb
    Tell is an Applescript directive.
    It sounds like you are trying to enter an Applescript into the Terminal. Won't work (not entirely true).
    Try the Applescript Editor instead.
    What are you trying to script?

    There is a better forum for Applescript under Mac OS X Technologies.
  • by Torn Barb,

    Torn Barb Torn Barb Apr 5, 2011 4:33 PM in response to Barney-15E
    Level 1 (0 points)
    Apr 5, 2011 4:33 PM in response to Barney-15E
    Can I stick to this thread until I figure this out? Or unless a moderator moves my post?

    I'm just playing with scripting right now. I started a few years ago on RedHat, BSD, and now OS X. I'm running test scripts just to play around and to brush up on my commands and lines. Here's a simple one which apparently the only way to do it, from what I see on the web, is to open safari via command line with multiple tabs. Everyone says use 'tell'.

    When I write the bash script it says, tell not found.
  • by Barney-15E,

    Barney-15E Barney-15E Apr 5, 2011 4:57 PM in response to Torn Barb
    Level 9 (50,767 points)
    Mac OS X
    Apr 5, 2011 4:57 PM in response to Torn Barb
    Tell is not a bash command. It is an Applescript command.

    You can stay here. And, I did ask for you to post what you are trying to do. Meaning, give me more info and I'll try to help, but there is a better forum for both Applescript and unix.
    Post the code between
    code here 
    tags.

    Oops. I just checked the man page. tell is also a tcl command. Are you trying to create a tcl-based script. In that case, I can't help you.
    If it is Applescript, I may be able to.

    Message was edited by: Barney-15E

    Digging further, telltc is a csh command. It prints all terminal capabilities.

    Message was edited by: Barney-15E
  • by Torn Barb,

    Torn Barb Torn Barb Apr 5, 2011 4:58 PM in response to Barney-15E
    Level 1 (0 points)
    Apr 5, 2011 4:58 PM in response to Barney-15E
    Ooops.....here you go:

    property URL1 : "http://www.apple.com/"
    property URL2 : "http://www.macosxhints.com/"
    property URL3 : "http://www.neturf.com/"

    tell application "Safari"
    activate
    my new_tab()
    open location URL1
    my new_tab()
    set the URL of document 1 to URL2
    my new_tab()
    set the URL of document 1 to URL3
    end tell

    on new_tab()
    tell application "Safari" to activate
    tell application "System Events"
    tell process "Safari"
    click menu item "New Tab" of menu "File" of menu bar 1
    end tell
    end tell
    end new_tab
  • by Barney-15E,

    Barney-15E Barney-15E Apr 5, 2011 5:31 PM in response to Torn Barb
    Level 9 (50,767 points)
    Mac OS X
    Apr 5, 2011 5:31 PM in response to Torn Barb
    That is an Applescript. Open Applescript Editor and paste it in. You can run it from there or save it as an application. (or whatever instructions that were posted on the site you found it.)
  • by Parker288,

    Parker288 Parker288 Oct 5, 2016 8:54 AM in response to Barney-15E
    Level 1 (4 points)
    Oct 5, 2016 8:54 AM in response to Barney-15E

    Can you help me.

     

    do shell script "open '/Applications/Google Chrome.app'

    tell application 'Google Chrome' to activate

    tell application 'System Events'

    keystroke f using {command down, shift down}

    end tell"

     

    When I run this, it says tell command is not found...

    What am I doing wrong?

  • by Barney-15E,

    Barney-15E Barney-15E Oct 5, 2016 10:24 PM in response to Parker288
    Level 9 (50,767 points)
    Mac OS X
    Oct 5, 2016 10:24 PM in response to Parker288

    Parker288 wrote:

     

    Can you help me.

     

    do shell script "open '/Applications/Google Chrome.app'

    tell application 'Google Chrome' to activate

    tell application 'System Events'

    keystroke f using {command down, shift down}

    end tell"

     

    When I run this, it says tell command is not found...

    What am I doing wrong?

    You never terminated the do shell script argument with double quotes.

    yowever, You don't need the first line as the second does that already.

     

    For the rest, AppleScript uses double quotes, not single.