• 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: How to test if a Mail folder exists?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to test if a Mail folder exists?


  • Subject: Re: How to test if a Mail folder exists?
  • From: Robert Nicholson <email@hidden>
  • Date: Mon, 25 Jan 2010 19:07:32 -0600

When your script runs how fast does it run? Mine isn't exactly a speed daemon when moving messages.

This seemed to be faster than try on error end try

			if not (the mailbox folderName exists) then

On Jan 23, 2010, at 4:18 PM, Emmanuel LEVY wrote:

> No faster way, this is how to do it. New AppleScripters may find it weird, in AppleScript it's common practice to use a try structure to test some property.
>
> Emmanuel
>
>
> On Jan 23, 2010, at 4:32 PM, Robert Nicholson wrote:
>
>> Is there a faster way than this?
>>
>> My script to move email seems to do it ever so slowly
>>
>> the idea is to test whether the mailbox exists first and create it if it doesn't.
>>
>> 			try
>> 				set archiveMailbox to (mailbox folderName)
>> 			on error
>> 				log "Creating mailbox " & folderName
>> 				make new mailbox with properties {name:folderName}
>> 			end try
>>
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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

 _______________________________________________
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: How to test if a Mail folder exists?
      • From: Emmanuel LEVY <email@hidden>
References: 
 >How to test if a Mail folder exists? (From: Robert Nicholson <email@hidden>)
 >Re: How to test if a Mail folder exists? (From: Emmanuel LEVY <email@hidden>)

  • Prev by Date: Re: starting iCal and Address Book iconified, with py-appscript
  • Next by Date: Re: "Open for access weirdness"
  • Previous by thread: Re: How to test if a Mail folder exists?
  • Next by thread: Re: How to test if a Mail folder exists?
  • Index(es):
    • Date
    • Thread