How to make a closed loop wait?

My current script is:
do shell script "open '/Applications/Adobe Photoshop CS6/Adobe Photoshop CS6.app'"
delay 5
do shell script "killall 'Adobe Photoshop CS6'"
do shell script "killall 'PDApp'"
Right now it is a timed wait, but if one time Photoshop doesn't open before 5 seconds, it screws the program. I also don't want to put a long timed wait either. Is there a way to trigger the quit Photoshop and Adobe Application Manager once the program is done loading and open?

Try this:
tell application "Adobe Photoshop CS6"
  activate
          try
                    name of window 1
          end try
  delay 5
  quit
end tell
the request for name of window 1 (or any other simple applescript command) can't be processed until photoshop is fully loaded, and the script won't move on until that value is returned. (it's in a try block so that you don't get an error if there's no window).

Similar Messages

  • How to make the main() thread wait?

    I would like to know how to make the main() thread wait for another thread?If I use wait() method in main() method it says "non-static method wait() cannot be referenced from a static context",since main()
    is static.

    Here is an example how you may wait for a Thread in the main -
    but be careful, this is no real OO:
    public class WaitMain {
    // this is the thread class - you may also create
    // a runnable - I use a inner class to
    // keep my example simple
         public static class ThreadWait extends Thread{
              public void doSomething(){
                   synchronized(syncObject){
                        System.out.println("Do Something");
                        syncObject.notify();
              public void run(){
                   // sleep 10 seconds - this is
                   // a placeholder to do something in the thread
                   try{
                        sleep(10000);
                        doSomething();
                        sleep(10000);
                   catch(InterruptedException exc){
    // this is the object we wait for -
    // it is just a synchronizer, nothing else
         private static Object syncObject = new Object();
         public static void main(String[] args) {
              System.out.println("This will start a thread and wait for \"doSomething\"");
              ThreadWait t= new ThreadWait();
              t.start();
              synchronized(syncObject){
                   try{
    // this will wait for the notify
                        syncObject.wait();
                        System.out.println("The doSomething is now over!");
                   catch(InterruptedException exc){
              // do your stuff

  • How to make in the loop codes?

    How to make in the loop codes to have like my output(below)?
    For example:
    I am trying to figure out how to make them correct the way I want to have the output.
    String start = "02-01-08";
    String end = "02-29-08";
    Calendar a = new GregorianCalendar();
    while( start <= end ) {
              a.add(Calendar.DAY_OF_WEEK, 7);
              Date d = a.getTime();
              DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
              String ss = df.format(d);
              System.out.println(ss);
    }The output:
    +02-01-08+
    +02-08-08+
    +02-15-08+
    +02-22-08+
    +02-29-08+
    Anybody know how to make it correct?

    artist_tech07 wrote:
    I am confused where is the answer in the doc that you gave me?Read my first reply and read the docs. Then read them again.
    And then re-read this
    To do what you want you need a start and end Dates. These you can compare in one numeric form or the other. For example by using getTime.
    Then during each loop iteration you will need to add *1 day (using the Calendar)* to the start date.
    I am telling you what methods to use. I have told you were you can find those methods. I have given you a link to the Calendar class API. All you have to do is put 2 and 2 together. Or at the very least make an attempt to do so.

  • How to make the session to wait until other session get closed successfully

    Hi ,
    In my program , I am calling sql loader and after that I am opening a session and inside that I am calling stored procedure which validates the data.
    above calling of sql loader and stored procedure is done inside the shell script i.e .prog file which is registerd as host concurrent program.
    Here i am facing the problem like when two files are processed with same content then second file content's are not erroring out as duplicate though there is a duplicate validation exist inside the procedure. IF I call dbms_lock.sleep(60) then it is working and sencond file are records are error out with duplicate error message. but this is working only for small data files.
    Please suggest me how to make the session to come out successfully then only i can open other sesssion .
    Thanks
    Raghav

    user5853450 wrote:
    Hi ,
    In my program , I am calling sql loader and after that I am opening a session and inside that I am calling stored procedure which validates the data.
    above calling of sql loader and stored procedure is done inside the shell script i.e .prog file which is registerd as host concurrent program.
    Here i am facing the problem like when two files are processed with same content then second file content's are not erroring out as duplicate though there is a duplicate validation exist inside the procedure. IF I call dbms_lock.sleep(60) then it is working and sencond file are records are error out with duplicate error message. but this is working only for small data files.
    Please suggest me how to make the session to come out successfully then only i can open other sesssion .
    Thanks
    RaghavFor starters you could use external tables rather than SQL*Loader and then you could keep all the control on the database side of things rather than relying on an external utility. The external tables will give you all the functionality of SQL*Loader but all you to just read the data using SQL select statements instead and cut out all the shell script dependency.
    Alternatively you could also look at Job Chaining...
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14214/chapter1.htm#FEATURENO05574

  • How to make a switch loop? ( Read inside for more info.)

    I'm working on a project using switch and I want to know how to make it loop/ or is it possible to do so with for or while. If anyone could help me I'd be very thankfull.
    Since my switch is too long I'll make an example:
    System.out.println();
    System.out.println();
    System.out.println("Zgjedhni operacionin: ");
    System.out.println("1. Mbledhja A + B\n");
    System.out.println("2. Zbritja A - B\n");
    optionNumber = sc.nextInt();
    switch ( optionNumber ) {               
                        case 1: System.out.println("\nMbledhja A + B: ");
                              s11 = (a11+b11);
                              s12 = (a12+b12);
                              s13 = (a13+b13);
                              s21 = (a21+b21);
                              s22 = (a22+b22);
                              s23 = (a23+b23);
                              s31 = (a31+b31);
                              s32 = (a32+b32);
                              s33 = (a33+b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;
                        case 2: System.out.println("\nZbritja A - B: ");
                              s11 = (a11-b11);
                              s12 = (a12-b12);
                              s13 = (a13-b13);
                              s21 = (a21-b21);
                              s22 = (a22-b22);
                              s23 = (a23-b23);
                              s31 = (a31-b31);
                              s32 = (a32-b32);
                              s33 = (a33-b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;I've got the variables declared of course :P so now what I want after doing case 1 or case 2 or any other cases ( 9 in my program) I want to make a question if I want to do another operation and start again from beginning :$/

    Solved it.
    do {
    System.out.println();
    System.out.println();
    System.out.println("Zgjedhni operacionin: ");
    System.out.println("1. Mbledhja A + B\n");
    System.out.println("2. Zbritja A - B\n");
    optionNumber = sc.nextInt();
    switch ( optionNumber ) {               
                        case 1: System.out.println("\nMbledhja A + B: ");
                              s11 = (a11+b11);
                              s12 = (a12+b12);
                              s13 = (a13+b13);
                              s21 = (a21+b21);
                              s22 = (a22+b22);
                              s23 = (a23+b23);
                              s31 = (a31+b31);
                              s32 = (a32+b32);
                              s33 = (a33+b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;
                        case 2: System.out.println("\nZbritja A - B: ");
                              s11 = (a11-b11);
                              s12 = (a12-b12);
                              s13 = (a13-b13);
                              s21 = (a21-b21);
                              s22 = (a22-b22);
                              s23 = (a23-b23);
                              s31 = (a31-b31);
                              s32 = (a32-b32);
                              s33 = (a33-b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;
    System.out.println("Doni te beni edhe nje operacion?: ");
    vazhdo = sc.next().equalsIgnoreCase("PO");
    while ( vazhdo == true);Sorry for double posting can't see an edit button :$

  • How to make a Thread loop?

    Hi, I was wondering how to make a thread start over again from the beginning once it finishes, if it hasn't been stopped already.

    package src.Utility;
    public class ThreaTest extends Thread{
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              ThreaTest threaTest= new ThreaTest();
              while(true){
                   try{
                   if (!threaTest.isAlive()){
                        threaTest= new ThreaTest();
                        threaTest.start();
                   }//else{
                        //System.out.println("");
                   }catch (Exception e) {
                        e.printStackTrace();
         public void run(){
              System.out.println("-----11---------");
    }try the above code and then tell me if this loop works for you???

  • Spry Accord. Panel - How to make it closed Please help!

    Hi, I would like to ask for your help with the following:
    I made a spry accord. panel. I was wondering how to make the first tab being closed when I open up the following page. Somehow when I made it, it created that the first tab stays open all the time. I was wondering if I can make it being closed and only open when I click on the Artisan Collection.
    Thank you so much for your help in advance! Agi
    Here is the link and you will see the panel on the left handside:
    http://mallinfurniture.com/browse_c01.html

    Hi,
    Thank you so much for the answers. I tried what you recommended. An error message came up saying the following. Also, I noticed something weird in my coding... Maybe that is why it is not working. I copy the coding as well. Thank you so much for taking the time to help me out!!!
    Error message: "This document contains JavaScript code for a widget that no longer exists. If you don't remove the code, the browser might display JavaScript errors when loading the page. Would you like Dreamweaver to find all the instances of this code for you?" Ok, No.
    When I click on Ok. Nothing happens. What am I doing wrong?
    Coding - the end of my page:
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("CatalogMenu", {defaultPanel: params.panel ? params.panel: 0});
    //-->
    </script>
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1", { useFixedPanelHeights: false, defaultPanel: -1 }); //--> </script> </body>
    </html>
    It looks like I have double of that. When I removed the first accordion, all of my panels were opened...
    What could ne wrong?
    Thank you! Agi

  • How can I make a while loop wait 10 seconds before iterations​?

    I am using labview to for an osmosis system that measures the amout of water lost from the reading on a scale.  
    I currently have the program displaying the data from 3 scales every second.
    I also need to calculate the flux through the membrane over time.
    I do this with a function that takes a change in the scale reading over time (with a shift register) followed by a series of mathematical conversions.
    The readings from the scale display OK every second, but I need to have at least 10 seconds between flux calculations.
    So my question is, how do I make a the shift register take one value from the scale, then wait 10 seconds before taking the second value?  That way I have the mass of water lost over a 10 msecond period.  
    Below is my current while loop for Flux using shift registers from data from 3 scales.  
    Any helkp would be great!
    Also, I'm new at LabVIEW...

    Bob_Schor wrote:
    Do you understand how Dataflow (a key idea behind LabVIEW) works?  If you put a Wait (ms) function (on the Timing Palette) with 10000 (10,000 milliseconds = 10 seconds) inside your While Loop, the principles of Data Flow will require all of the functions inside the While (specifically the Wait function) to finish their execution before the loop can run again.  As everything else in the loop takes approximately 0 seconds, this will make your loop run once every 10 seconds.
    Bob Schor
    I do not think that is a good idea. 
    The inner loop should be in sync with the outer loop, not run independent on it's own timer.
    If the inner loop is running independently you run the risk of using stale data.
    Actually  altenbach is right the inner loop does not need to be a for loop at all, but rather just a case like my suggestion (without the for loop) and the shift registers should be out on the main loop.
    My suggestion was a quick solution going by what little bit of the block diagram I could see, but if the entire code was posted I am sure we would see where more improvements could be made and possibly even a better solution.

  • How can I make a while loop wait for input boolean?

    Hi.
    I'm trying to control a robotic arm with labview for my undergrad dissertation, and I have a decent polar coordinate control panel made, but there is one problem; it checks for changes in the coordinates every five seconds, while I want it to only check on the touch of a button (ie, go!, I've changed your coordinates!). The changes are calculated with a while loop comparing the last value of theta, x and z in a while loop with the current one. I can't find a way of putting that into a case structure. If there is a way of making the while loop progress at the push of a button, I think it would work. The VI's attached below.
    Thanks in advance for any help.
    Cathal Scanlon
    ps, sorry about the mess, I'm going to reorganise the while loop into 2 if I can get the control button working.
    Message Edited by CatScan on 02-08-2007 02:45 PM
    Attachments:
    Polar coord assignment1.vi ‏142 KB

    Have you tried using an event structure? To use one, right click on the structure to add an event. Set the event as whatever button you wish to monitor and set the event to "Value Change". If you put this inside a while loop any time the button is pressed, the event structure will run the contents inside the loop. There are a number of options to have the event structure activate.
    *** Warning! I'm probably the last guy you want answering your labVIEW questions, but I figured I might be able to help.

  • How to make my object to wait for server response

    Hi ,
    I need some one suggestions on thread concepts.
    First Let me know my scenario is fit for thread concept.
    is it possible then how I can reach to solution.
    I have scenario like
    I send a request to server and server is taking some time to process the request.
    if I am calling the method on server it showing no results bez i know server takes some time.
    for that my calling method has to be wait for some time.
    Thanks
    Babu H

    Hi ,
    Let me give more information about that between my java class and server
    i have the bridge library which is also written in other than java.
    for that i used the njawin tool make as java wrapper class and accessing the java wrapper class(Bridge Server).
    the java wrapper class has post_request and poll_response methods so that why i 'm using only these methods in my java class to access the server.
    exactly I don't which technology is resided in Brdige server and actual Server bez that has been developed some one.
    poll_respnse means server has posted the response to client.
    Thanks
    Babu H

  • Help on how to make an infinite loop with the same space on all images

    HI:
    I made a movie clip with infinite  loop in which there are images that move from right to left something simple like a marquee, and each image has a blank space between  them, but between last and first image there is a more space, how I can do to  make all images have an equal space between each one and that the motion never stops.

    Thanks for your time and answers my friend, but I'm still not be able to achieve what I want, I forgot to tell that I'm doing this by layers, let's say, I have 5 images, (in fact I have like 50 images converted to movie clip symbols) each image has it's own layer, layer 1, layer 2, layer 3, layer 4, layer 5, then I put a 200 frame motion tween on all layers at 30 fps, then I arranged layer 1 on the first frame to the frame 200, the second layer from frame 50 to frame 250, third layer from frame 100 to frame 300, fourth layer from frame 150 to frame 350, and fifth layer from frame 200 to frame 400, by this I mean I put a 50 frame of space on each image but if you can see, the last image has a duration from frame 200 to frame 400, and there's nothing on frame 250 where it is supposed to be another image to match the same blank space of all the others, the movie clip restarts on the frame 400, and there's a 150 frames of blank space between the last image and the first image, I put the gotoandplay on the frame 250, but it abruptly restarts the movie.
    Is there another way to do this ?
    Am I doing something wrong ?
    Please I really really need help on this.
    Thanks

  • How to make one thread to wait for others in this situation?

    i am simulating a 2 phase locking system (shared and exclusive locks). multiple clients connects and requests for lock to a single server. at the server end, we have a class Server which implements Runnable interface. for each connection, a new Server object is created and a new thread is started. when a conflicting lock request is made by a client, the corresponding thread in the server end must wait until other threads corresponding to clients holding the lock releases it. and when all the locks in conflicting mode are released, the thread releasing the last conflicting lock must notify the waiting thread.
    but the wait() and notifyAll() methods are not working as desired. i guess this is because each thread is working on different Server objects.
    how can i implement the waiting and notifying mechanism?

    Let me recap your question: your Server is a single resource to which
    multiple Clients want access in a CREW (Concurrent Read Exclusive Write)
    fashion. You need a single object somewhere that can serve as the
    single monitor for locking. A Singleton object like this should do it:public class CREW {
       private static CREW crew= new CREW();
       public static getCREW() { return crew; }
       private boolean wite;
       private int read;
       public synchronized acquireReadLock() {
          // your read locking stuff here
       public synchronized acquireWriteLock() {
          // your write locking stuff here
    }... the important part is that there is a single object to lock on. The
    'acquire...' methods can be pooped up at will (a Command as a
    parameter mayhap?)
    kind regards,
    Jos

  • How to make a Video loop with FCP Express?

    Hi everybody. I need to make a lot of shorts videos with jpgs extracted from a main video. But those jpgs videos must be done as a loop that will returns and plays again forever (the videos will be placed in a web site) Is that possible, and if it is, what I need to do to obtain that loop?.
    Best Regards.
    Julian Laffont.

    Hi Tom. It's not for my web site. Is for someone else . I don't know what to do or say. Should I make a video with the jpgs and tell them that they need to use the looping application of their web site? (I don't know if they have that application) Also Will be good to know if there is a specific format of video that loops in the web sites?. Wich one will be.QTM, WMV I don't know.
    Thanks.

  • How to make a playlist loop

    I just bought a 5G video iPod a couple of days ago; it's my first and I know almost nothing about using it. Everything is working and the sound is wonderful. The problem is that there are apparently fewer controls than I'd expected and I haven't been able to control what it plays to the extent that I'd expected.
    The iPod is synched with my Mac and has what is supposed to be identical library and playlists. However, the Mac has lots of playlists set to loop (repeat), and the iPod doesn't seem to have that information: it isn't looping playlists that are set to loop on the Mac.
    Is this normal? And, whether it is or isn't normal, is there still a way to instruct the iPod with its own controls to loop a playlist? Another question: is there a way to instruct the iPod to shuffle a particular playlist and to determine the way it shuffles (example, by album instead of by song name)?
    The "Shuffle" menu item seems to apply only to the entire (very large) library. I don't see a way to apply its function to a particular playlist.
    In reply, please don't assume that I know anything about iPods. I don't, though I've looked through the pdf manual. Does anyone happen to know of any more complete online resources than the Apple manual?
    Thanks for any help,
    Mary

    Congratulations! Once you have gotten the hang of it, you will wonder how you ever lived without you new little friend!
    Anyway, in answer to your questions:
    The iPod is synched with my Mac and has what is
    supposed to be identical library and playlists.
    However, the Mac has lots of playlists set to loop
    (repeat), and the iPod doesn't seem to have that
    information: it isn't looping playlists that are set
    to loop on the Mac.
    Your iPod will loop a playlist, but you have to tell it to do that. This is done as follows:
    1) Select SETTINGS from the Main Menu
    2) Scroll down and click on REPEAT until you the option ALL displays to the right of REPEAT (ONE will only loop one song)
    3) Click Menu to return to the Main Menu, and then select the playlist you want to listen to. Your iPod will continue to loop this playlist until you stop.
    Infact, your iPod will continue to loop any play list (or Album) you select until you change that setting. Unfortunately, you can not set the iPod to only loop some playlists and not others - at least I haven't ever found a way to do that - But the REPEAT Setting should allow you to loop whey you want to.
    Another question:
    is there a way to instruct the iPod to shuffle a
    particular playlist and to determine the way it
    shuffles (example, by album instead of by song
    name)?
    Like the REPEAT Setting, there is no way to have the iPod shuffle some playlists a certain way, and others another way. However, you can use Settings to accomplish the same thing. Here's how:
    1) Select SETTINGS from the Main Menu
    2) Scroll down and click on SHUFFLE until the option YOU WANT displays to the right of SHUFFLE. Your options are to shuffle by SONG or ALBUM.
    3) Click Menu to return to the Main Menu, and then select the playlist you want to listen to. Your iPod will continue to shuffle the songs or albums in whatever playlist you select until you go back into settings and select SHUFFLE >>> OFF.
    The "Shuffle" menu item seems to apply only to the
    entire (very large) library. I don't see a way to
    apply its function to a particular playlist.
    This is true. The SHUFFLE on the Main Menu only applies to the entire library. But if you change the settings, as explained above, and then select the playlist you want suffled, you should be good to go.
    Hope that this helps!

  • How to make the print command wait until form is rendered.

    This is an ongoing issue that so far I haven't been able to figure out how to fix, so I'm hoping that someone will have a good idea or work around. I'm working in LiveCycle Designer ES v8. using JavaScript.
    I have to include a feature that allows the user the choice to print out a dynamic form to fill out by hand. So I've created a button that asks if this is what they want to do, if they answer "Yes", then several things are scripted to happen. All data is reset, some subforms and pages are made visible, while other subforms are hidden, and text fields are expanded. This causes the form to expand from one page to 15 pages. Then it prints using this command:
              xfa.host.print(1,   
    "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);
    The problem is that when the print dialogue box appears, the Print Range is always set to less than the total number of pages. It looks like that the print commands fires before the form has completed rendering. This isn't a big deal since the user can click to set the Print Range to "All" which will print all 15 pages. The problem is that most people don't read the dialogue box. They click "okay" and end up with their form cut off.  Then I get phone calls that my form doesn't work.
    Is there anyway to delay the print command until everything has finished rendering? Or set the Print Range to always go to "All"?
    Thanks in advance for your help with this.

    It sounds like you'd be fine if you just separated the print function from your "Yes" button. It will require a 2nd button click from the user but that would be the only inconvenience.

Maybe you are looking for

  • Error 7, report generation toolkits do not work after building.

    Hallo guys: one problem. help! I tried to build my programs with application builder, unluckly builded exe application does no work well as before, i checked some similar post from this forum, and added that NIReprot.llb in my project and rebuild, th

  • How to add a field object to group header section in crystal report document?

    Hi All, I have got two questions mentioned below, please share your inputs. 1)I want to know whether it is possible to add a field object to header section in crystal report document programmatically? I am using crystal runtime for visual studio. I k

  • Print pdf file directly from a folder, Adobe Reader X in  Windows Server 2003

    In previous versions of Adobe Reader we were able to print pdf files groupwise directly when selected in a folder. Now I've installed Reader X on the Windows Server 2003 environment. Logged in as administrator I can still select <Print> by selecting

  • Blank Screen for K8N Neo2, HELP!!!

    Ok, my computer used to be working, with windows XP Pro installed, but now it just won't boot up the monitor.  The last time I reinstalled the computer, it still wouldn't boot the screen, or would freeze at the platinum screen.  I don't think it is t

  • Saving Spotlight Comments?

    I saved some NBC "Meet the Press" netcasts as QuickTime movies to my hard drive. I want to be able to store comments with each movie as to who the guests and topics are for each show. When I copy the information and paste it into the "Spotlight Comme