Using Automater to run Terminal and enter a command

I am currently interested in using a script or the automator to open Terminal and enter a specific command line I use to authenticate on my university network. Frankly I'm getting tired of typing that command line in so often.
However, I am relatively new to apple, and I'm not very familiar with scripting. If someone could give some suggestions that would be great.

Open the Script Editor in the /Applications/AppleScript/ folder and type in the following:
do shell script "your command"
Save this script as an application and place it on the desktop for easy access. If the command requires the use of sudo, the needed syntax is:
do shell script "your command" password "yourpass" with administrator privileges
The actual phrase 'sudo ' isn't necessary in do shell script unless you will be passing sudo a flag. If the command needs interaction, use the following:
tell application "Terminal"
do script "your command"
end tell
This implementation requires the use of sudo for root authentication.
(20272)

Similar Messages

  • Trying to turn off spotlight because it's a resource hog.  open terminal and enter command but it won't respond or even ask for password.

    trying to turn off spotlight because it's a resource hog.  open terminal and enter command but it won't respond or even ask for password.

    Step #1:
    In System Preferences click on Spotlight.
    Step #2:
    Click on the Privacy tab here.
    Step #3:
    Click on the + button here and when the window opens click on "Macintosh HD" (or whatever you've named your HD) and then click the Choose button.

  • Using both at line-selection and at user-command

    hellow friends ,
    to use both  at line-selection and at user-command in the same report.

    Hello,
    U can do it like this.
    AT LINE-SELECTION.
      PERFORM at_line_selection.
    AT USER-COMMAND.
      PERFORM at_user_command.
    FORM AT_LINE_SELECTION.
      DATA: LV_CURSOR_FIELD(30).
      DATA: LV_MATNR TYPE MATNR.
      CLEAR H_UCOMM.
      GET CURSOR FIELD LV_CURSOR_FIELD.
      CASE LV_CURSOR_FIELD.
        WHEN 'PSPNR'.
          PERFORM LAGER_AN_PSP USING WA_MATNR-M1-RSNUM
                                     WA_MATNR-M1-RSPOS.
        WHEN 'PSPNR2'.
          H_UCOMM = 'PSPNR2'.
          IF NOT PSPNR2 IS INITIAL AND IT_VKBEL-VBELN CN '0123456789'.
            PERFORM LAGER_AN_PSP_VKBEL USING IT_VKBEL
                                             0
                                             PSPNR2
                                             H_MAKTX
                                             ' '.     "keine Blindbuchung
          ENDIF.
    ENDCASE.
    CASE SY-UCOMM.
        WHEN 'BACK_NEW'.
          PERFORM NEU_START USING 'X'.
        WHEN 'EXIT'.
          PERFORM NEU_START USING 'X'.
        WHEN 'CANC'.
          PERFORM NEU_START USING 'X'.
        WHEN 'CHECK'.
          PERFORM NEU_START USING SPACE.
    ENDCASE.
    Vasanth

  • Using automater to run the daily maintenance scripts

    I like to put my computer to sleep over night but the problem is that when I do that it doesn't run the maintenace scripts. Does anyone know how to do this with automater so that I can quickly run it before I put my powerbook to sleep?

    Derek
    I have my iMac go to sleep after an hour of non-use so it is shut down all night, usually.
    I downloaded the freeware program Anacron which runs the cron daily, weekly and monthly processes automatically when you wake your computer. I never have to worry about maintenance that way.

  • Open Terminal and Run Commands

    Hi I have to ping several IP adresses on a regular basis. Therefore I would like to create an Applescript application that will run terminal and ping the specified IPs so that I can see the results. Any ideas on how to best complete this?

    This script will prompt you to enter the number of times you want to ping each server. You'll need to specify the servers to ping in the "set serverAddresses..." line. It writes the results of each ping to a text file on your desktop and opens the file when finished. The next time you run the script if the text file exists it deletes it first.
    set theDesktop to (path to desktop)
    set serverAddresses to {"www.microsoft.com", "www.apple.com", "www.cnet.com"}
    set pingTimes to text returned of (display dialog "Ping each server how many times?" default answer "1" giving up after 10)
    tell application "Finder"
    if exists file (theDesktop & "ping replies.txt" as string) then
    delete file (theDesktop & "ping replies.txt" as string)
    end if
    set fileID to (open for access file (theDesktop & "ping replies.txt" as string) with write permission)
    repeat with aServer in serverAddresses
    try
    set pingReply to (do shell script "ping -c " & pingTimes & " " & aServer)
    on error
    set pingReply to "No reply from server " & aServer
    end try
    write (pingReply & return & return & "########################" & return & return) to fileID
    end repeat
    close access fileID
    open file (theDesktop & "ping replies.txt" as string)
    end tell
    Robert

  • Using X11 and Fink/Fink Commander to run Compiz Fusion?

    Hi! One of my friends who loves Ubuntu Linux showed me some weird app called Compiz Fusion and im like ooo... i wanna play wiht that. And I remembered that OS X had a way of installing Linux apps.. so I downloaded the .tar of compiz fusion and I also downloaded and installed Fink and Fink Commander for OS X 10.5.2 but um.. yeah Im not very good with running terminal and junk.. I was following directions so I checked my list of app packages Fink could install in Terminal but either I didnt see compiz or it came up as a name I didnt understand.. does anyone here have experience running X11 and Fink? Or if you have a link where I can teach myself X11 and Fink that would work too! Thanks in advance!

    thepotter wrote:
    Whoa there etersoft, I don't want to get in a flame war.
    Not to worry. I would lose interest long before that happened
    I didn't knock OSX except to point out an actual bug with X11.
    But it is not a bug with OSX if some 3rd party tool is not compatible. It is a Mac, not a Linux workstation. If you want to run Linux on it, you can install Linux on it. The Mac has its own window manager designed to allow most X11 apps run and not look too bad alongside the Mac apps. It really is a design feature.
    Personally, I like both.
    I like UNIX - a lot. But I'm not too fond of Linux. It is for people who do want to build their own machines out of components. I'm a software person, not a hardware person. That doesn't interest me in the least. As a software person, I have little interest in developing software for Linux because every single Linux box is unique. That is a hassle I don't want to deal with. That is why I like MacOS X so much - all the power of Solaris with the beauty and easy-of-use of a Mac.
    In the past there were tons of issues doing linux installs, and linux was fairly labeled as finicky and difficult. By the same token, when I was trying to upgrade to Leopard recently, I got a warning that my only option was "erase and install".
    You lucked out. Erase and install is the best way to install a major OS upgrade.
    No other options, no explanation why, no suggestions for fixing it -- it was as mysterious as a Linux install from 1999, albeit with a much prettier formatting error message.
    In 1999, I didn't even get that much from Linux. The X server just crashed as soon as the install was done and took the boot partition with it - reinstall from scratch. I have VectorLinux running in Parallels, but I never use it.

  • Used macbook air running OS 10 and I do not know the admin password so I can't get "in"

    Anyone know how to retrieve or work aorund not knowing a admin password?  I just bought a used macbook air running Mavricks and I don't know the **** password.  The company I bought the compuer from is only open from 5am till 5pm Mon-Fri and of course it is after that on a Friday night!
    Any help would be appreciated.

    Reboot holding down cmd-R. It will reboot to the recovery partition. Click the Utilitites menu, then Terminal.
    In Terminal, type
    resetpassword
    and follow the prompts.
    Matt

  • Creating/running Terminal command with Automator

    I am using Parallels Desktop on my iMac. Occasionally after I shutdown Parallels Desktop/Windows the ram it used is not released back, for example, depending on what I'm running in Parallels Desktop I can use upto around 16GB or ram. Ocassionally when I shutdown Windows and in doing that Parallels Desktop too, this ram level does not go back down. I find that going into Terminal and entering the purge command puts the ram level down to what it was before I loaded up Parallels Desktop.
    I was wondering if its possible to use Automator to create a shortcut that I could then either place on my Desktop or Dock and when needed I could just double click on it and it would then load Terminal and then the purge command?
    Or is there another way that I could automate the purge command?

    I managed to work it out for myself.
    I done the following:
    In Automator I chose Application/Run Shell Script. In the box that appeared in the right side I entered purge. I then saved it to my desired location and I then dragged it onto the Dock for easy access.

  • Automatic Payment Run-f110 Reg

    Hi,
    I am not FICO Guy.But,I need to run the Automatic payment Run -F110.
    Can you please explain step by step procedure how to run the F110.
    Thanks in advance.

    Select run date and enter and identification
    Enter your parameters, company code payment methods, next pmt date, select the vendors and/or customers
    On the free selection screen you can select values which can be included or excluded
    On the additional log screen select the type of logging that you require along with the vendors and customers
    On the printout data medium screen youcan select a variant to use when running the program
    Save the parameters
    Schedule the proposal and run it
    After proposal has been created verify it is correct
    Schedule the payment run, run it and note posting orders carried out
    You can use SP01 to faciliate the printing of checks
    Then you can create a payment file - FCHX
    Print a list of checks from the check register FCHN
    The following link may also assist you...
    http://help.sap.com/saphelp_47x200/helpdata/EN/01/a9c079455711d182b40000e829fbfe/frameset.htm

  • The address bar and all the command & tool bars disappear from my web page as soon as I log on. The leaves me with no way to enter a web address or navagate.

    When I attempt to use Firefox, the address bar and all the command & tool bars disappear from view as soon as I start the program. I can see the scrolling our of view at the top of my screen. This leaves me with no way to enter a web address, navigate or even exit the program.

    Make sure that you do not run Firefox in full screen mode (press F11 or Fn + F11 to toggle; Mac: command+Shift+F).<br />
    If you are in full screen mode then hover the mouse to the top to make the Navigation Toolbar and Tab bar appear.<br />
    You can click the Maximize button at the top right to leave full screen mode or right click empty space on a toolbar and use "Exit Full Screen Mode" or press F11.

  • Access Terminal and select applet

    Hi people,
    I have a question about to run the aplet in a javacard. Is there any code or other useful material about getting terminal and select applet and run the methods of the apllet in a programmable manner? Thanks for your interest...
    Edited by: POLAT on Mar 16, 2009 7:41 PM

    Honestly I haven't figured out how to pass a pin when selecting the applet, however at the minute I have a way around it:
    you will see in teh code below, I have hardcoded a default pin and I have a pin update method that can be called via a apdu,
    NOTE this example works with the code above:
    *Applet ID 41 63 63 6F 75 6E 74 41 70 70 6C
    public class AccountApplet extends Applet {
         final static byte ACCOUNT_CLA = (byte)0xB0;
         final static byte VERIFY = (byte) 0x20;
         final static byte CREDIT = (byte) 0x30;
         final static byte DEBIT = (byte) 0x40;
         final static byte GET_BALANCE = (byte) 0x50;
         final static byte UPDATE_PIN = (byte) 0x60;
         final static short MAX_BALANCE = 10000;
         final static byte MAX_TRANSACTION_AMOUNT = 100;
         final static byte PIN_TRY_LIMIT =(byte)0x03;
         final static byte MAX_PIN_SIZE =(byte)0x08;
         // Applet-specific status words:
         OwnerPIN pin;
         short balance = 109; // Starting balance of decimal 109 is 6D in hex
         public static void install(byte[] bArray, short bOffset, byte bLength) {
                        new AccountApplet(bArray, (short) (bOffset + 1), bArray[bOffset]);
         private AccountApplet(byte[] bArray, short bOffset, byte bLength){
              pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
              // bArray contains the default PIN initialization value (12345)
              bArray[0] = 01;
              bArray[1] = 02;
              bArray[2] = 03;
              bArray[3] = 04;
              bArray[4] = 05;
              bOffset = 0;
              bLength = 5;
              pin.update(bArray, bOffset, bLength);
              register();
         public boolean select() {
         if (pin.getTriesRemaining() == 0)
                   return false;
              return true;
    public void deselect() {
         pin.reset();
         public void process(APDU apdu) {
    byte[] buffer = apdu.getBuffer();
              if (selectingApplet())
                   return;
              if (buffer[ISO7816.OFFSET_CLA] != ACCOUNT_CLA)
                   ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
              switch (buffer[ISO7816.OFFSET_INS]) {
              case GET_BALANCE:          getBalance(apdu);      return;
              case DEBIT:                    debit(apdu);             return;
              case CREDIT:               credit(apdu);           return;
              case VERIFY:               verify(apdu);          return;
              case UPDATE_PIN:          updatePin(apdu);     return;
              default:                    ISOException.throwIt
              (ISO7816.SW_INS_NOT_SUPPORTED);
    private void credit(APDU apdu) {
              if (!pin.isValidated())
                   ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
              byte[] buffer = apdu.getBuffer();
         byte numBytes = buffer[ISO7816.OFFSET_LC];
              byte byteRead = (byte)(apdu.setIncomingAndReceive());
              if (( numBytes != 1 ) || (byteRead != 1))
                   ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
              byte creditAmount = buffer[ISO7816.OFFSET_CDATA];
              if (( creditAmount > MAX_TRANSACTION_AMOUNT)
                        || ( creditAmount < 0 ))
                   ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
              if ((short)( balance + creditAmount)  > MAX_BALANCE)
                   ISOException.throwIt(SW_EXCEED_MAXIMUM_BALANCE);
              balance = (short)(balance + creditAmount);
              return;
         private void updatePin(APDU apdu) {
              if (! pin.isValidated())
                   ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
              byte[] buffer = apdu.getBuffer();
              byte numBytes = buffer[ISO7816.OFFSET_LC];
              byte byteRead = (byte)(apdu.setIncomingAndReceive());
                   if (byteRead != numBytes) {
                   ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
                   if ( numBytes > 8 )
                   ISOException.throwIt(SW_PIN_TO_LONG);
              if ( numBytes < 4 )
                   ISOException.throwIt(SW_PIN_TO_SHORT);     
              short offset_cdata = 05;          
              pin.update(buffer, offset_cdata, numBytes);
              pin.resetAndUnblock();
         private void debit(APDU apdu) {
              if (! pin.isValidated())
                   ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
              byte[] buffer = apdu.getBuffer();
              byte numBytes = (byte)(buffer[ISO7816.OFFSET_LC]);
         byte byteRead = (byte)(apdu.setIncomingAndReceive());
              if (( numBytes != 1 ) || (byteRead != 1))
                   ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
         byte debitAmount = buffer[ISO7816.OFFSET_CDATA];
              if (( debitAmount > MAX_TRANSACTION_AMOUNT)
                        ||  ( debitAmount < 0 ))
                   ISOException.throwIt(SW_INVALID_TRANSACTION_AMOUNT);
              if ((short)( balance - debitAmount ) < (short)0)
                   ISOException.throwIt(SW_NEGATIVE_BALANCE);
              balance = (short) (balance - debitAmount);
         }      private void getBalance(APDU apdu) {
              byte[] buffer = apdu.getBuffer();
              short le = apdu.setOutgoing();
              apdu.setOutgoingLength((byte)2);
         Util.setShort(buffer, (short)0, balance);
              apdu.sendBytes((short)0, (short)2);
          * verification method to verify the PIN
         private void verify(APDU apdu) {
              byte[] buffer = apdu.getBuffer();
              byte byteRead = (byte)(apdu.setIncomingAndReceive());
              if (pin.check(buffer, ISO7816.OFFSET_CDATA,byteRead)
                        == false)
                   ISOException.throwIt(SW_VERIFICATION_FAILED);
         } // end of verify method
    } // end of class Account

  • Anyone use VMware to run windows on a intel macboon pro

    I am looking for a reliable emulator to run widows as an application in my macbook pro.
    Does anyone have any experience with the VM WARE player or such.
    Any help is appriciated.
    Happy Holidays All,
    Grant Parkis

    I use Parallels to run Vista and XP Pro. However it is not nessecary to run emulation software any longer on the mac platform, since Intel processors make it possible to run these OS's natively.
    While I do use Parallels to run Windows. For the few moments i really do need to do such a silly thing, Bootcamp is MUCH better to use because Parallels emulates windows, and Bootcamp literally lets you partition the HD for a space to install the OS for real. If anyone is wondering, IMO Bootcamp is a bit more of an inconvienant because you have to reboot into the other partition, Parallels is quicker because it can be opened in its own window, and boot very fast. BUT Paralells is a bit quirky in its operation/emulation of WIndows. BC is not at all and runs as you would expect it to on any Intel computer.

  • I have a Mac Pro Intel Xeon 3.2 Ghz Quad core (mid 2012) using OSX 10.7.5) and cannot get iDVD to run.

    I have a Mac Pro Intel Xeon 3.2 Ghz Quad core (mid 2012) using OSX 10.7.5) and cannot get iDVD to run. I tried 7.0.4 and 7.1.2, both from Apple software update and both crash during "loading themes". I am reluctant to upgrade OSX from 10.7.5 because I do not want to loose Final Cut Express 4.0.1. Apple Care no longer supports iDVD. I want a version if iDVD that supports Chapter markers as in iDVD 7.?.? that i used with my old (now deceased) Apple Power PC Mac Pro.

    iDVD 7 should work fine with 10.7.5.  Try this basic troubleshooting fix:
    1 - delete the IDVD preference file, com.apple.iDVD.plist, that resides in your
    User/Home/Library/ Preferences folder.
    2 - delete IDVD'S cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iDVD folder. 
    3 - launch IDVD and try again.
    NOTE: In Lion and Mountain Lion the Home/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and press the Return key - 10.7: Un-hide the User Library folder.
    OT

  • Create Run And Stop Buttons on Front Panel, rather than using the toolbar run/stop

    I would like to make my vi more user friendly by creating start and stop buttons on the front panel. I havent found much info on how to create them. I have created a boolean stop button to stop my FOR LOOP.
    -Chris

    Creating the buttons is easy - just select the style you want from the Boolean palette. What you need to do is change your diagram and the VI properties. To have a VI automatically start running when opened, open VI Properties by selecting that under the File menu or right clicking the VI's icon. Select Execution and check the Run when opened box. If you need the user to enter some data or change parameters before running the program, there's a couple of ways to go about it with a front panel Start button. You could have a separate while loop with just the start button in it and connect an output of that to a main while loop. This creates data flow and ensures that the start while loop executes before the main. You could create a simple state machine. T
    here's a couple of shipping examples. Just open the Example Finder and enter state for the keyword. You could also use the Event structure. Again, there are several shipping examples. Instead of doing a search, you could also browse the Example Finder and look at what's underneath the Building User Interfaces topic.
    p.s. I don't think you created a stop button for a for loop as there is no way to stop a for loop. What you can stop is a while loop.

  • This copy of Microsoft Office 2013 cannot be used on a computer running Terminal Services" error message when you try to open the Click-to-Run version of an Office 2013 program or suite on a terminal server

    Hi All,
    I have Citrix VDI (Virtual Desktop Infrastructure) Implemented
    in my company and installed few Applications on App Server lets say.... MS Office 2013, filzialla, putty, etc...
    I assigned these apps to the users through CITRIX STUDIO, when I try to use these apps. on VDI everything is working fine only when i tried to open Word, Excel or Powerpoing, outlook it throws error as 
    ""This copy of Microsoft Office 2013 cannot be used on a computer running Terminal Services" error message when you try to open the Click-to-Run version of an Office 2013 program or suite on
    a terminal server"" and apps gets closed.
    Please help me on this ASAP.
    Thanks & Regards,
    Sachin Shinde

    Hi,
    As mentioned in ths article below, run for Office 365 products on to a Remote Desktop Session Host server is not supported. You can install Office products for Office 365 to a virtual desktop, but the virtual desktop must be assigned to a single user.
    http://technet.microsoft.com/en-us/library/jj219423(v=office.15).aspx
    Regards,
    Melon Chen
    TechNet Community Support

Maybe you are looking for

  • Issues after Vista---- Win7 migration

    Hi, I upgraded my T400s from Vista Prof to Win7 Prof 32 bit yesterday, and it did NOT go smooth. I had to start over after an error message given in the process. Anyway I ended up having to format my preload drive and installed there. Coming back up

  • Can window and aggregate SQL functions be used in Pro*C embedded SQL?

    It appears that window functions such as dense_rank() over(partition by ... order by ...) can not be used in Pro*C embedded SQL? Can somebody confirm that that is really the case? Thanks Rawender Guron

  • Database cannot be Opened

    hi Database mounted,but not able to open Version 10.2.0.1.0 Not in Archived mode Thanks

  • SIMS 3 for Macbook Pro

    Recently bought a Macbook Pro and I'm disappointed coz I can't use it to play Sims 3. One of the requirements to play is the Nvidia Geforce series: 7300, 7600, 8600, 8800, 9400M, etc. My Mac's 320M...boo!!! =( Is there a Sims 3 version for the 320M G

  • Email can't open

    Am using Bberry 9810 and am having problem with opening one mail from eBay which I receive daily,whn I try to open the mail it closes bt am able to read other mails !!help