Bring app to front... without activate?

is there a way to make a current running app the front app without using activate... or to tell activate to NOT open the app if its not open... or... well
heres my problem...
I'll have a few apps on my machine of different versions while testing stuff. messing with Wine apps and X11 and stuff, a lot of times things get thrown to the back, so i want to give a simple command to OSX that can bring it to the front as the active app.
using...
osascript -e "tell application \"AppName\" to activate"
usually makes it come up front... but the problem is occasionally if I have a different app on the computer that has the same name and preferences file, that it instead opens that app up and tries to run it, throwing the app i wanted in the background...
so basically I want a way to activate an app as the main app simply, but to find the current running app, not try to open any other apps that aren't open...
using osascript I didn't want to make it super complicated checking whats running and names and all kinds of logic just to decide what to activate. I'm thinking there has to be a simpler way to do this, with Applescript or some other way....
any help is appreciated

the problem is timing... and I don't want to use any type of delay/sleep commands, I want it to go as soon as it can... going for speed.
The problem is... my app has to run multiple other apps and many processes. What I have to do is have an app launch in the background (an X11 build actually, not default X11.app), and then do some other things... then the final results are all running in the X11 app, so I need to bring it back to the front most application. The problem is, the place my script gets to, to wait for the X11 app, the X11 app is not always finished loading completely. If i tell it to activate to bring it back up front, and its fully done loading, then it works fine. Times when its not fully done loading (usually just a second or less away), OSX goes and finds another app with the same name and ID and launches it instead.... sometimes...
This will lead to rare and annoying bugs with my app... though most of the time it would work fine. On older, slower machines it messes up most of the time.
I have started using tell application id "$APPIDNUMBER"
I tried this in the bash script
/usr/bin/osascript <<END
repeat
if application id "$IDNAME" is running
tell application id "$IDNAME" to activate
exit repeat
end if
end repeat
END
so it basically set in a loop until that program was running. The bash script its running out of works fine on 10.5 and 10.6 doing that as far as I could tell, but only when running it directly, which doesn't happen, when it was opened from another process, it gets stuck in the loop forever, no matter what the id does.... it also didn't work at all on 10.4, it apparently doesn't understand "is running"
so trying to find a way to do this only when the app is actually running, to tell it to activate... without using arbitrary wait states... cuz that leads to problems, especially for portability and longevity....

Similar Messages

  • What is "bring all to front"

    Under the Window menu is the item "bring all to front" and I have no idea what that means.  I thought it meant to get current windows shown but so far nothing happens when I click on that option.  ??????????????

    For the application showing in the upper left-hand corner, selecting that option brings all of its open windows to the front or on top of any other app's open windows.

  • I want to set up an app store account without a credit card

    i want to set up an app store account without a credit card and it shows on the help site online an option to set up with none but on my phone it only shows visa mastercard and amex i already updated the software to the 5.0.1

    i tried those steps on my phone before creating an account
    i am still stuck with the 3 choices. i went so far as to create other accounts from scratch to get the choices. i did not even have itunes on the 2nd computer i tried on so would be hard to sign out of it

  • I had to take the I pad I got for Christmas back and they gave me  new one.  Is there a way I can get the books and apps I purchased without having to buy them again?

    I got an I pad for Christmas and had to return it and they gave me a new one.  Is there a way I can get the books and apps I purchased without paying for them again?

    Downloading past purchases from the App Store, iBookstore, and iTunes Store: http://support.apple.com/kb/HT2519

  • My New ipad3, when i click onthe camera app, the front camera works but the other camera only shows a black screen ! Is there something wrong with my iPad ?

    My New ipad3, when i click onthe camera app, the front camera works but the other camera only shows a black screen ! Is there something wrong with my iPad ?

    Try a Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. When the screen goes blank power On again in the normal way.] It is absolutely/appsolutely safe!

  • [AIR] May I catch "bring window to front" event?

    Hi,
    I wonder who is responsible for bringing windows to front when user click on that window (application contains more Windows components inside). Is it operating system or AIR runtime? Or perhaps AIR runtime send event to operating system which does it? In this case there would be some chance to catch and stop propagation of that event not to let operating system bring that window to front. Am I right? Any idea how to do it?
    //pyso

    This thread explains my experiences with the toFront() method on Windows 98. It works, but only if the frame has been hidden for about 20 seconds.
    http://forum.java.sun.com/thread.jsp?forum=57&thread=426257

  • How do I bring components to front?

    Does anybody know, if I have overlapping components like JLabels, how can I choose which one to bring to the front?
    In other words, if I have two overlapping JLabels, how can I choose which one gets seen.

    I don't know if you can do this programmatically with one call (like the WinAPI setWindowPos and specify the z order and appropriate flag).
    Swing components are displayed in the order they are added to the container, with the first component being the top most.
    Regards,
    Nick G.

  • Method to bring component to front?

    Hey all
    I am looking for a method that can be used to bring a component to front in my applet. I have a few choice menus that arent showing up and i believe it is because labels are being drawn over them.
    The choice menus do not show up at all normally, but they appear just fine if I
    setVisible(false) to the labels.
    It has always been my understanding that components will show up in the order they are added to the applet. So if the labels are added first, then the menu second - the menu should be on top. However my applet also requires a lot of setVisible(true/false) and I am not sure if that is affecting the layering also. Would setting a component as visible automatically bring it to front, or would it remain where it has been added?
    SO, if there is a bring to front method kicking around that would definately solve my problem.
    thanks for the help.

    If possible could you post your compilable code that simulate your
    problem or in short your SSCCE.

  • Automator: Bring Window to Front

    I have been looking for a workflow that can bring a non-active window into active view e.g. bring a window that is in the background to the front view.
    There is no workflow in automator for this action but i wondered if anyone has come across some apple script that is capable of doing this? I could work the apple script into automator.
    Thanks,
    Adrian

    The window i am trying to bring to the front is called 'WorkflowServiceRunner'. Its not an application in the available list in Launch Application action.

  • Bring text to front of image

    how do i bring text to front of image using dream
    weaver?

    You would set the image as a background image- that would be
    a possible
    option. Please remember that the text will not stay static
    and will shift
    when a viewer resizes the text.
    You cannot lose until you give up !!!
    "berry05" <[email protected]> wrote in
    message
    news:fsk74t$d4r$[email protected]..
    > how do i bring text to front of image using dream
    weaver?

  • HT4943 I am deploying to Afghanistan and I will not have wifi access.  I will have a hardline access to internet.  How do I sync my apps, newsstand, etc without wifi connection?

    I am deploying to Afghanistan and I will not have wifi access.  I will have a hardline access to internet.  How do I sync my apps, newsstand, etc without wifi connection?

    About the only other way I can think of is to have a computer with you or use one there, if you can put iTunes on it and download all your new stuff to the computer, then sync your iPad to that computer.
    In switching computers you will lose previous content, but, as I understand it anyway, downloaded content will be the same as long as the same apple ID is used.

  • How can I know if my app will work without wifi during traveling trips

    HHow can I know iv my apps will work without wifi

    On an iPad the easiest way is to pull up Control Center and tap the wifi icon to turn it off.

  • App-V v5 without SQL

    App-V v5 without SQL, is it possible? Cant afford a SQL server :)

    Hi, 
    The issue is related to App-V, you can ask for help from App-V forums
    http://social.technet.microsoft.com/Forums/en-US/home?forum=mdopappv
    Regards,
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to verify my app store account without having to use a credit card ?

    How to verify my app store account without having to use a credit card ?

    - Whenn Yhuu First Gett A Iphonee &&'d Wanna Set Uhpp A App Storee Account Will Thee Credit Card Stuff Bhee Ohnn There ?'. &&"d Do Yhuu Havee oo2 Confirm Thee Apple Account From Yahoo .com ?'.
    Some Plz Help Lbvs I'vee Madee Likee 5 Alreadyy Ihmm Neww Do Ihtt '.

  • How can I retrieve a deleted app from iTunes without paying for it again?

    My kids keep deleting my apps off the iPad accidentally. How can I retrieve these apps from iTunes without paying for them again?

    How to redownload purchased apps from the App Store

Maybe you are looking for

  • How to pass Schedule lines of an item Line to 'BAPI_QUOTATION_CREATEFROMDAT

    Hi Friends, I am trying to create Sales Quotation using the  'BAPI_QUOTATION_CREATEFROMDATA2'  from Webdynpro Application. I am able to create the quotation with Line items, but I am not able to pass the multiple schedul line for an Item line. it tak

  • Drill down report update

    Hi, How to add several currency value (USD, LKR) in drill down report - in Due Date Analysis for open Item report (S_ALR_87012168) Thanx.

  • Win 8 to win 8.1 with boot camp again or to update?

    can we easy update win 8x64 to win 8.1 via microsoft website,just finished win 8 installation over boot camp but i was wondering since microsoft is offering 8.1 on their site for free can we just update it like that or we need to find win 8.1 x64 iso

  • How to connect and export specific schemas in SQL plus

    Hello, Wanted to clarify on a few things. - Can an Oracle 10g Release 10.2 client be used to connect to a oracle 10.1 database? - Is there an option to "connect" (not refer) to a specific schema, say "SchemaA" in SQL plus in order to run a specific s

  • How resize the image after drag drop according to container

    Hi, I have a image which can be drag drop in different size of containers. After drop i want to resize the image by maintaining the aspect ratio according to the container in which it is going to be drop. I will be very thankful for your help.