• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Loops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loops


  • Subject: Re: Loops
  • From: Michael <email@hidden>
  • Date: Fri, 1 Feb 2008 05:22:42 -0800

Thanks again...but...
May I ask some specifics.


On Feb 1, 2008, at 1:59 AM, Michael wrote:

Question 1) Will AS "wait" for the action to be completed eg moving a file
2) How does it know that the action has been successfully transacted ( assuming the answer to 1 is yes)


3) Is it ever possible for a loop to "outpace" it's asked for action.

1) In general, when a script tells an application to do something, it sends a message to the application, and waits for the application to send back an "I'm done, and here's the result" message before it continues.

So, is it as easy as checking for "Empty" to know if an action was not carried out? Let's say the command is to "Delete a file". Would the result be "File Deleted". Or let's say the command was to "Find a file"...Would you expect a "not found" to produce and error or simply return "Empty". I guess I am trying to get a feel for the syntax of AS.





3) The script can also use the "ignoring application responses" modifier to just send the message to the application, and not bother waiting for a reply. In this case, the script has no direct way of knowing when or if the operating has completed, but it can use indirect methods to check (for example, looking for the file in the destination folder).

I tried this and it seemed to work well....when it worked!




4) In theory, if you don't use "ignoring application responses" a script shouldn't be able to "get ahead of" the application, since it always waits for the application to complete an operation before it does the next thing (see 1).

I guess in my case, it **may??** be different..but maybe not. I was using RB to compose and write the App that searches, asks for user input etc. Then, when a list of files ( emails) are defined, I simply ran a loop sending AS commands ( each specifically composed for a particular file/email) to move that e-mail. The result was really hit and miss. Sometimes the emails were moved, sometimes only part of the list was moved, and if the list was really big ( artificially made so my me to test the program) it often just failed after say 10 or 20 of a 12,000 list of emails. I was also not that tuned into the finer details of AS that I could adequately troubleshoot it...but I think your explanation has helped. ( You said at one point you slowed down a loop by inserting a one second delay.)



Michael.





_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Loops
      • From: "J. Stewart" <email@hidden>
    • Re: Loops
      • From: Peter Baxter <email@hidden>
    • Re: Loops
      • From: "Gary (Lists)" <email@hidden>
References: 
 >Re: Loops (From: Neil Faiman <email@hidden>)

  • Prev by Date: Re: Loops
  • Next by Date: Re: Loops
  • Previous by thread: Re: Loops
  • Next by thread: Re: Loops
  • Index(es):
    • Date
    • Thread