How to wait until an Entourage Schedule item completed

I am trying to script the "Send & Receive All" operation in Entourage, and I have found that I can trigger the process off (from within my script) by:
tell application "Microsoft Entourage"
execute schedule "Send & Receive All"
end tell
However, the script continues to process while the scheduled actions take place.
Is there any way to wait until the schedule actions complete and then process the rest of the script?
Thanks
Susan

Glad to help, Susan
I found out about "connection in progress" by looking at the properties of "application" in the Entourage dictionary:
connection in progress boolean [r/o] -- Are there any network connections in progress?
(In fact I searched through the dictionary for the phrase "connect".) The property is a boolean (true/false), and my script uses a "repeat while" loop to test for that boolean condition.
As well as properties, the Entourage application object also has elements. These include "POP account", "IMAP account", "Exchange account" and "Hotmail account". These can be referred to "by numeric index, test". So if you pass a list of accounts to the "connect" command, Entourage will connect and download mail from those accounts. For example, if you have two POP accounts, this works:
tell application "Microsoft Entourage" to connect to {POP account 1, POP account 2}
AppleScript lists are contained in curly braces.
But it's simpler (and less prone to error) to do this:
tell application "Microsoft Entourage" to connect to every POP account
Alternatively, the "test" lets you refer to individual accounts by name - a list isn't essential, despite what the dictionary says:
tell application "Microsoft Entourage" to connect to POP account "My Account"
There's many ways of skinning a cat.
To answer your more general question, though, there is no one "user guide" for AppleScript. You can learn the about the basics of the language from the AppleScript Language Guide. But that will tell you nothing about how to script particular applications. This is because every developer, if they do implement AppleScript in their application (and lots don't), implements it in different ways.
So as well as learning AS, for each application that you want to script you have to learn a slightly different set of commands. There's an awful lot of trial and error involved, but one way to learn is to look at scripts that others have written. There are good resources at Apple's own AppleScript page and at AppleScript Central among others. For specifically scripting Entourage, try Paul Berkowitz's scripts.
Different people will also recommend different books. My recommendation is AppleScript: The Definitive Guide by Matt Neuberg, but again it's not application-specific.
Hope this helps, at least to give you some pointers.
H

Similar Messages

  • How to wait until setPage(number) is finished

    SR 3-8311228061
    When calling getStrings, found I need to iterate the pages of the doc/xls/etc
    However Autovue Support tells me that setPage() is asynchronous
    I asked how to wait until setPage() is complete, they suggested I post the question here
    Note, at the time its called the viewer (desktop version 20.2.2) is on the task tray, but not rendering the document
    Its only loaded to extract the text
    here is the blip of code
    for( curPage = 1; curPage <= pages; curPage++)
    vueBean.setPage( curPage ); //its necessary to call setPage even for page 1
    //If setpage fails stop (per Daniel/Oracle)
    int thisPage = vueBean.getPage();
    if( curPage != thisPage )
    //This message never shows up
    String msg = String.format("Pages[%d] thisPage[%d] curPage[%d] ", pages, thisPage, curPage);
    AdeptApplication.INSTANCE.publishEvent("file-event", msg,
    new SystemEvent(this.fileName, "GETTEXT_PAGEFAILED"));
    break;

    The code you have is to know whether changing pages succeeded or not, and unless you are trying to set a page number that is out of the page count it will always succeed
    So, yes, your test is the same as if (false)
    Now, page loading is done in an asynchronous manner
    1. you ensure that the page (the container for all the page artifacts) is created, synchronously
    2. the page content are streamed on another thread
    3. once the page is loaded, an event is sent VueEvent(VueEvent.FILEEVENT, VueEvent.ONPAGELOADED)
    So you should be able to query for info after you received the page loaded event
    Now, word documents are an special kind of documents, so you need to be aware of some specific issues.
    The same way ms-word does not know the total number of pages until the ENTIRE document is loaded, AutoVue will not be able to notify you either.
    And as Word, AutoVue allows you to display the pages that are already loaded, and you may query for some of its contents too.  BUT you can not query for page info when the page is been loaded (or obviously not yet loaded)
    The loading is a 2 phase one, part is done on the server (native code) and part is on the java side (display)
    So you will not be able to iterate
    for( curPage = 1; curPage <= pages; curPage++)
    simply because page count is not known.  You need to query doc info more than once.
    If page count = -1, you need to iterate for each page and then, test whether setPage() != getPage() and/or page count has been updated.

  • In our program, we are concerned about reducing CPU work; how to wait until a boolean condition changes in a "while loop"?

    Is there a way to wait until a boolean condition changes (instruction is sent) in a "while loop" (because I want the program run until I press exit button)? Now it is consuming a lot of CPU because it is running the loop very fast waiting for instructions unless I stop the program.
    Thank you.

    Use /functions/time and dialog/wait until next millisecond multiple in the
    loop. Input 100ms.
    "mcdesm" wrote in message
    news:[email protected]..
    > In our program, we are concerned about reducing CPU work; how to wait
    > until a boolean condition changes in a "while loop"?
    >
    > Is there a way to wait until a boolean condition changes (instruction
    > is sent) in a "while loop" (because I want the program run until I
    > press exit button)? Now it is consuming a lot of CPU because it is
    > running the loop very fast waiting for instructions unless I stop the
    > program.
    >
    > Thank you.

  • How to wait until the 1st part of the processing is done

    Hi,
    I had a hard time to combine two parts of processing in one .vi file, and thus would like to get some advice/help through the forum.
    Attached is the partial finished vi file I made. You can see that it is composed of two parts. The upper part is to run a bat file (check_result.bat), which generates a result.txt file. The lower part is to use the result.txt file as an input file, and check if the key word called "test case passed" is included in the result.txt file or not. So I want to run the upper part firstly, and then run the lower part after the upper part is finished.
    However, I don't know how to connect the two parts in a right way that the lower part only starts running after the upper part is finished. Any comments/help is highly appreciated.
    Thank you in advance.
    Xuedong 
    Attachments:
    question.vi ‏49 KB

    The magic of dataflow!
    All you need is a data dependency between the two parts. Often critical parts of each section contain error terminals, so you can just string em along in the proper order and each part must wait until the previous node has finished.
    In your particular case, the read operation has no error input, so you can recruit any other input. Create a fake data dependency by strategically placing a small sequence frame containing common code. The sequence cannot start until all code that provides imputs has finished, serving your purpose.
    Of course it seems silly to even try to read the file if the previous node failed. Right? So simply place the second part inside a case and hook it up to the error output. Now the second part (1) waits until the first part has finished AND (2) execute only of the first part succeeded. No sequence needed.
    All clear?  
    Message Edited by altenbach on 02-07-2007 02:34 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    dataflow.gif ‏4 KB
    dataflow2.gif ‏4 KB

  • URLLoader - how to wait until URL is loaded and then contine...

    Hello,
    I have litle problem because I don't know how to load
    external XML file, wait when loading is completed and after that
    continue with next code.
    Consider following situation. I have a function in
    actionscript, let's say, handleXML()
    function handleXML() {
    someURLRequest = new URLRequest("some XML file");
    someURLLoader.addEventListener("complete","LoadCompleted");
    someURLLoader.load(someURLRequest );
    Alert.show("Print Second")
    function LoadCompleted(event:Event) {
    someXML = XML(someURLLoader.data)
    Alert.Show("Print first")
    The problem is, when someURLLoader.load is called, Alert
    window with Print second is displayed and then "Print first" alert
    is displayed because flex perform action behind someURLLoader.load
    and then perform function LoadCompleted().
    I would like that first, when someURLLoader.load is called, flex
    wait until external XML is loaded, display "Prinf first" alert AND
    THEN continue with code and displat "Print second" alert.
    It is possible to do it someway??
    thanks for help

    Hi, thanks for answer, but I think it is the same:) So what
    happens if I change your code like this...
    srv = new HTTPService();
    srv.url = "some XML file";
    srv.resultFormat = "xml";
    srv.addEventListener( ResultEvent.RESULT, loadCompleted );
    srv.send();
    Alert.show("Print Second")
    function loadCompleted( event:ResultEvent ) : void
    someXML = XML(event.result);
    Alert.show("Print First")
    In this case, after calling srv.send(), next code in the
    fuction is performed, so the Alert "Print Second"" is dsplayed.
    After that, URL request is completed and "Print Second" appears. I
    think it is because data calls are asynchronous. Is it there a
    possibillity to wait after calling send() function, until the
    request is processed and then continue with code which the send()
    function was called from ? It means, first Alert.show("Print
    First") is executed and then Alert.show("Print Second").???

  • How to wait until html page is completely rendered

    I use a JEditorPane to display HTML and i want to print it to an image. so i tried to load the page (JEditorPane.setPage(URL url)) and wait until the property "page" is fired. Then i printed the component to an image.
    My problem is that the page wasn't completely loaded (rendered?) when i tried to print it.
    Is there a way to be notified when the page is completely rendered?
    thx in advance
    ~elchaschab

    However, you might consider setting the document property for it to be
    loaded synchronously.i've already used my own HTMLEditorKit for synchronous document loading.
    class MyHTMLEditorKit
    extends HTMLEditorKit
    public Document createDefaultDocument()
    Document doc = super.createDefaultDocument();
    ((HTMLDocument)doc).setAsynchronousLoadPriority( -1);
    return doc;
    You probably already played around with calling repaint() and
    validate() before printing.i tried to call repaint and validate before printing but
    still it doen't work. :(
    As a last resort, you could experiment with calling the printing
    routine written as a thread passed to invokeLater(), although there is
    no obvious reason why this would make a difference. i don't understand what i should do with invokeLater().
    could you please give me a short example?
    thx,
    elchaschab

  • How to wait until all components painted?

    Hi - I have searched for hours for an answer to this and have yet to find something so any help is much appreciated!
    Ive posted some code below to simulate the problem im facing. This is a simple frame which has a couple of custom jPanels embedded within it.
    When this is run, the first 3 lines i see are:         I want this comment to be the last thing output
            Now finished panel paint
            Now finished panel paintBut, as this output suggests, i want the "I want this comment to be the last thing output" line to be displayed after the two panels are completely painted on the screen (in real life i need to know my components are displayed before the program can move on to further processing). Of course, if you cause a repaint you see the "now finished panel paint" each time, but im not interested in this, im simply interested in how to overcome this when the frame is first created and shown.
    Ive tried everything i can think of at the "// ***** What do i need to put here? ******" position but nothing seems to work... In short my question is how can i construct my frame and get it to ensure that all components are fully displayed before moving on?
    Sorry if the answer to this is obvious to someone who knows these things, but its driving me mad.
    Cheers
    import javax.swing.*;
    import java.awt.*;
    public class Frame1 extends JFrame {
      public static void main(String[] args) {
        Frame1 frame1 = new Frame1();
        // ***** What do i need to put here? ******
        // to ensure that the System.err.. call below
        // is only executed once both panels paint methods
        // have finished?????
        System.err.println("I want this comment to be the last thing output");
        System.err.flush();
      public Frame1() {
        this.getContentPane().setLayout(new FlowLayout());
        MyPanel  p1 = new MyPanel(); p1.setBackground(Color.red);
        MyPanel  p2 = new MyPanel(); p2.setBackground(Color.green);
        this.getContentPane().add(p1, null);
        this.getContentPane().add(p2, null);
        this.pack();
        this.setVisible(true);
      class MyPanel extends JPanel {
        Dimension preferredSize = new Dimension(200,200);
        public Dimension getPreferredSize() { return preferredSize;  }
        public MyPanel () { }
        public synchronized void paintComponent(Graphics g) {
          super.paintComponent(g);  //paint background
          // do some irrelevant drawing to simulate a bit of work...
          for (int i=0; i<200; i+=20) {
            g.drawString("help please!",50,i);
          System.err.println("Now finished panel paint"); System.err.flush();
        } // end of MyPanel
      }

    Thanks both for your replies.
    When doing the "Runnable runnable = new Runnable(){public void run(){ frame1.paint(frame1.getGraphics());....." method i sometimes see
        Now finished panel paint
        Now finished panel paint
        I want this comment to be the last thing output       
        Now finished panel paint
        Now finished panel paintwhich is a pain.
    As for making a new Runnable to do the system.err.println and then doing the SwingUtilities(invoke) on that runnable, that didnt work for me at all.
    So... in the end, my solution was to have the paint method set a boolean when finished and the main program sleep while this is false
         // Dont want to sleep for say a few seconds as cant be sure
         //painting will be finished, must monitor state of painting ...
         //therefore use while loop
         while (!isOk) {  // isOk is true when both panel paint methods complete
             System.err.println("Waiting......");
             try{   Thread.sleep(300 /* wait some time */);  }
             catch(Exception e){}
           System.err.println("Thankfully this works");which is a kind of mixture of both your suggestions i guess!
    Thanks for your help, much appreciated.

  • Program needs to wait until BDC will get over

    Hi Experts,
    In my report program i am using BDC call transaction. Once this BDC action will get over after that i need todo some logic in my program. How to wait until BDC will get over?
    Anyone have idea?
        CALL TRANSACTION 'CK41' USING  zdata
                                OPTIONS  FROM g_s_options
                                MESSAGES INTO msg_tab.
        PERFORM call_processing USING wa_default-kalaid
                                         wa_default-klvar
                                         wa_default-kokrs
                                         wa_default-bukrs.
    Mohana

    Hi,
    Program gets over in BDC call transaction after call transaction statement.
    If you use call transaction statement as below,
      CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'     MESSAGES INTO messtab.
    Here Update 'S' means update will be syncronouse so program will wait untill this BDC gets completed, if you will not select this statement then by default program may take update 'A' which is asyncronouse means BDC will be processed parallel to this program, please check.
    After this call transaction statement you can do code changes as per your requirment in the same program.

  • File Adapter -- Picking has to wait untill it get fully loaded/write.

    Hi All,
    I need to pick the files from a folder and I need to pick the files only which has been written completely.
    I should not pick the file in the middle while writing, I need to wait untill it finishes the writing completely.
    Is there any setting I can put in Sender File adapter to do this?
    Thanks
    Seema

    Nithya,
    >> Try to increase the processing time in the sender communication channel, so that it allows you to completely load the file. Check the time which is needed to upload the file to the directory manually and correspondingly change the processing time.
    We do not know exactly at what time the file will be placed in the folder. It may be at any time. So I cannot put the processing time accurately.
    Aamir,
    >> If you are picking from FTP,MSecs wont work there.the sender program which writes the file must write the file in some temporary format like .dat etc and once the file is complete it should change the filename to .txt,configure the sender file adapter to pick only *.txt files.
    This is a good idea. But I don't think I can ask them to change at the other end as it is working previously with other middleware.
    Guys,
    Can you please advice which is the best thing we can do at this point of time.?
    Thanks
    Seema.

  • When I attempt to update to a new version of i-Tunes I am prompted That another version is currently being downloaded and to wait until this is comleted before downloading any new version.

    When I attempt to download an up to date version of i-Tunes on my Windows Vista laptop I am prompted to wait until an earlier version has finished installing before installing a new version. I attemted to uninstall ALL traces of iTunes so that I could start with a 'clean sheet', however I was again informed that I had wait until the previous installation was completed. Can anyone help. ?

    Hi there,
    You may find the troubleshooting steps in the article below helpful.
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    -Griff W. 

  • How can I wait until a Swing.Timer has finished?

    I have a Swing.Timer runing which displays some animated text (more precisely it fades out a text with a delay of 50 until all characters are erased.
    Afterwards a time consuming operation shall begin. How can I achieve that this operation waits to start until the text has been faded out? The time to fade out the text depends on the length of the text, of course.
    So, how can I make the operation waiting until the Timer has finished its work?
    Thanks,
    Dirk

    dirku wrote:
    I have a Swing.Timer runing which displays some animated text (more precisely it fades out a text with a delay of 50 until all characters are erased.
    Afterwards a time consuming operation shall begin. How can I achieve that this operation waits to start until the text has been faded out? The time to fade out the text depends on the length of the text, of course.
    So, how can I make the operation waiting until the Timer has finished its work?I gave you an answer to this with sample code yesterday:
    [http://forum.java.sun.com/thread.jspa?threadID=5294087&messageID=10244564#10244564|http://forum.java.sun.com/thread.jspa?threadID=5294087&messageID=10244564#10244564]
            public void actionPerformed(ActionEvent e)
                if (sb.length() > 0)
                    sb.deleteCharAt(0);
                    label.setText(sb.toString());
                else
                    label.setForeground(color);
                    label.setText(text);
                    Timer timer = (Timer)e.getSource();
                    timer.stop();
                    // ***** start process here ***
            }The timer here continues until a condition is satisfied (here it's where the Stringbuffer that holds the text that is sent to the JLabel is empty). So all you have to do is place any code that needs to happen when the Timer ends in the else block. It's so simple as to be trivial.

  • How can i get program to wait until file is loaded?

    Hi all,
    I keep getting a null pointer exception error thrown when it shouldn't. I'm 99% certain that its being generated because the program speed is faster than the load file time. Is there any way to make the program wait until the file is finished loading? I know you can set up a for loop that will take up some time but I wanted it to be more accurate so that no errors will occur on any machine. Here is the code
    RunMainProg();
              String[] TempHolder = new String[HowMany*2];
              try
                  BufferedReader readerOne = new BufferedReader(new FileReader("TempMDLFile.txt")); // file just save from RunMainProg()
                  String lineOne;
                  int i=0;
                       while ((lineOne = readerOne.readLine()) != null)
                            if(i>=TempHolder.length)
                            break;
                             TempHolder=lineOne;
                             i++;
              readerOne.close();
                   catch (IOException f)
                        MakeDialog ErrorDialog = new MakeDialog(TopWindow, "Load Error", "Error - The file you entered does not exist", "Error", "OK", "OK", 0, 0);
                   for(int i=0; i<TempHolder.length; i++)
                        if(TempHolder[i] == null)
                        i=0;
                   FormatData TestSequences = new FormatData(TempHolder); // problem occurs at this line
    I have looked all over and can't seem to find a way to verify if the file is loaded, or to get it to wait until it has. Any help would be much appreciated. Especially if you can supply some code snippets :)
    Much obliged
    Drb2k2

    okay, I added some test code that I was using to try and iron out the problem. Perhaps its best if I run through what happens.
    1. I get the data from the text box, and an external program is run which generates some text files. These files are then loaded and examined and some new data is appended to the old. This is the process
    FormatData TestSequences = new FormatData(TempHolder); Now every time its run first time around its fine.
    2. When I try and do exactly the same thing with the new appended set of data the null exception is thrown. Now Dr Clap, I thought exactly the same as you did, but... If i add the following bit of code before the FormatData call..
    for(int i=0; i<TempHolder.length; i++)
    System.out.println(TempHolder);
    It will produce the data without the appended info, and some null sequences.
    The size of TempHolder is adjusted depending on the amount of data submitted, so somewhere along the line its just not working.
    3. Now for the fun part, eventually if you put the call in a loop it will correct itself and produce the outcome, but needless to say i'd rather not have my program catching a load of nullpointerException errors.
    Finally as for the code
    for(int i=0; i<TempHolder.length; i++)               {                    if(TempHolder[i] == null)                    i=0;               }That was an attempt to stall the program until no null sequences were found. Sort of getting around the problem in 3.
    Dr Clap is a legend on these posts and his advice is well recieved but I have no idea how to view a stack trace or what benefit it has. Any tips on this would be great.
    Thanks for your help so far
    drb2k2

  • How many days I have to wait until Blackberry App world complete my vendor registration?

    Hello comunity some days ago I sent my official Government Issued Identification to [email protected] (in order to the next step for completing my registration) does anyone know how many days I have to wait until Blackberry App world complete my vendor registration?
    Regardd 

    This is not the AppWorld vendor section of the forum.
    I will ask a moderator to please move your thread to the correct area.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • My iPad Air have a screen problem so I sent it to iService (I'm Thai) but they told me that they don't know how long that I have to wait until I will get a new one? Can anyone help me?

    My iPad Air have a screen problem so I sent it to iService (I'm Thai)
    but they told me that they don't know how long that I have to wait until I will get a new one?
    Because they said there's no stock in Singapore
    Can anyone help me?
    Just bought on 15/11/2013

    You can call iService and ask to speak with a manager.

  • How much longer do I have to wait untill my 100Gb sim arrive?

    HI there,
    I woudl like to ask how much longer will I have to wait untill the 100Gb summer sim,  that I ordered last week, arrive ? 
    I can see from other post  that some people's been waiting few weeks and still nothing. 
    Kind regards Luke

    Hello 
    Welcome to the EE Community! If your SIM card hasn't arrived and it's been longer than three working days since you placed your order, you can send EE an email to [email protected] with your name, address and date of order. Hope this helps!Titanium Was my post helpful? Please take 2 seconds to hit the 'Kudos' button below

Maybe you are looking for