1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Need help with a script pls

Discussion in 'Apple Mac' started by Swiper, Feb 13, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. Swiper

    Swiper Thread Starter

    Joined:
    Mar 13, 2003
    Messages:
    1,230
    Here is an example of the script being used
    problem is, i can get the application to start up, but I need it to enter a keystroke return
    OR click on OK button to completely launch the program and i can't get it to work

    where would I put this on the script for it to work ?

    script: below

    can anyone help ?
     
  2. Headrush

    Headrush

    Joined:
    Feb 9, 2005
    Messages:
    2,609
    Your first line should start and activate the app. (not sure what the other lines are for)

    If you change the application in the script, do other applications start OK without the return keystroke?

    If you save the script as an Application you can save it anywhere you want and double click to run it.
     
  3. Swiper

    Swiper Thread Starter

    Joined:
    Mar 13, 2003
    Messages:
    1,230
    thx for the reponse
    there is more to the script
    it maps a drive (to windows share) which works
    it launches the app without any problem, but I can not get it to click on OK button ( hit ENTER key)
    so the progam fully launches


    the script is already running as an application
    and set to stay open
    its also set so that if the app in question, crashes for any reason, the script will detect that it is not running, and relaunch the app
    its just the hitting of the OK button (clicking on enter key) that I can't seem to get to work

    i believe the script needs something along the lines of
    delay 5 / or delay 10
    keystroke return


    but, can't seem to find the correct location in the script to actually get it to run
    driving me crazy !!
     
  4. Headrush

    Headrush

    Joined:
    Feb 9, 2005
    Messages:
    2,609
    This is the part I don't understand, what OK button?

    This sounds like something application specific and you might need to check that application's applescript dictionary on how to start with out that.

    If possible naming the app might help also.

    Edit: Or is this a dialog you are displaying from Applescript and want to dismiss after time?
     
  5. Swiper

    Swiper Thread Starter

    Joined:
    Mar 13, 2003
    Messages:
    1,230
    When the application first starts, it needs a click on OK or Hit Enter Key to completely start
    otherwise it just sits partially opened up
    for example
    the program is designed to start up, connect to a database ..............and it needs to autologin, to the databse and requires someone / something to click on an OK button or hit ENTER key to completely log in and have it start to function

    i would like for the script that i have running to launch this application/program and have it hit on the OK button in the application to fully autologin and start functioning
     
  6. Headrush

    Headrush

    Joined:
    Feb 9, 2005
    Messages:
    2,609
    Code:
    tell application "System Events"
         keystroke return
    end tell
     
  7. Swiper

    Swiper Thread Starter

    Joined:
    Mar 13, 2003
    Messages:
    1,230
    Thanks
    I finally figured out a way to get it to work
    much like the way you mentioned

    thanks alot !!
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1089411

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice