Results 1 to 7 of 7
  1. #1
    Quick Apple Script Question
    ezhangin's Avatar
    Member Since
    Jun 10, 2005
    Location
    Indiana; there's more than just corn here
    Posts
    237
    Specs:
    Powerbook G4 1.67 MHz
    Quick Apple Script Question
    How would I enter a line of text into terminal via an apple script? I got the script to open terminal, i need the script to then enter one line of text into terminal, and then it opens another application (which also works). So basically I can't figure out how to just enter text into terminal through an apple script. Anyone know?

  2. #2
    Quick Apple Script Question
    johninc's Avatar
    Member Since
    Dec 28, 2004
    Location
    Albany, CA
    Posts
    643
    Specs:
    ibook G4 12 inch running mac os 10.4 with: 60 gb HD+256 mb ram+Radeon 9200
    You don't even need to open terminal:

    do shell script "command for terminal here"
    then if you want the result displayed in a window:

    do shell script "command for terminal here"
    display dialog "" & result & ""

    oops just realized you wanted to enter text into terminal.... Give me a minute for that...

  3. #3
    Quick Apple Script Question
    johninc's Avatar
    Member Since
    Dec 28, 2004
    Location
    Albany, CA
    Posts
    643
    Specs:
    ibook G4 12 inch running mac os 10.4 with: 60 gb HD+256 mb ram+Radeon 9200
    All right there we go it enters it and displays it in terminal:

    tell application "Terminal"
    do script "command for terminal here"
    end tell

  4. #4
    Quick Apple Script Question
    surfwax95's Avatar
    Member Since
    Aug 27, 2005
    Location
    Fayetteville, AR
    Posts
    2,406
    Specs:
    15" Powerbook G4 24" iMac iPhone 3Gs
    I was looking for this same answer, but the script mentioned gets an error: "Terminal couldn't complete the operation because it is not connected."

    I just tried a "top" command.
    I try to Command+Shift+/ when I can.
    They're - Their - There | Two - Too - To | You're - Your | MAC - Mac
    I was on the M-F honor roll for October, 2006.

  5. #5
    Quick Apple Script Question
    johninc's Avatar
    Member Since
    Dec 28, 2004
    Location
    Albany, CA
    Posts
    643
    Specs:
    ibook G4 12 inch running mac os 10.4 with: 60 gb HD+256 mb ram+Radeon 9200
    probably depends what type of command your using I tested that on the uptime command and it worked great.

  6. #6
    Quick Apple Script Question
    ezhangin's Avatar
    Member Since
    Jun 10, 2005
    Location
    Indiana; there's more than just corn here
    Posts
    237
    Specs:
    Powerbook G4 1.67 MHz
    I want to run a python script inside of a terminal window

  7. #7
    Quick Apple Script Question
    johninc's Avatar
    Member Since
    Dec 28, 2004
    Location
    Albany, CA
    Posts
    643
    Specs:
    ibook G4 12 inch running mac os 10.4 with: 60 gb HD+256 mb ram+Radeon 9200
    o can't help ya there I have no experience in python.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Quick Script Question! (hopefully
    By MrWilson78 in forum OS X - Operating System
    Replies: 0
    Last Post: 05-28-2015, 04:57 AM
  2. Quick question regarding a shell script
    By Seventh in forum OS X - Operating System
    Replies: 1
    Last Post: 03-27-2012, 08:25 PM
  3. Apple-Script question
    By Markuse in forum OS X - Operating System
    Replies: 3
    Last Post: 05-20-2011, 03:23 PM
  4. Apple Script Question
    By Eric Lundquist in forum OS X - Apps and Games
    Replies: 1
    Last Post: 01-28-2009, 11:11 PM
  5. Quick Apple Script Question
    By ezhangin in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 03-22-2006, 07:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •