• 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: subfolder in entourage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: subfolder in entourage


  • Subject: Re: subfolder in entourage
  • From: Andrew Oliver <email@hidden>
  • Date: Thu, 29 Sep 2005 10:06:00 -0700

On 9/29/05 5:21 AM, "Giampiero Cairo" <email@hidden> wrote:

> Hi, I have a problem. I want to get the subfolder of folder "InBox"
>
> This is my snippet :
>
> tell application "Microsoft Entourage"
>    set FoldersList to "" as string
>    repeat with i in every folder
>        set FoldersList to name of i
>        tell FoldersList
>            repeat with z in folder of FoldersList
>                set FoldersList2 to name of z
>            end repeat
>        end tell
>    end repeat
> end tell
>
> When i try to run this script I get this exception The error is
> "Impossible to get folder of Inbox"
>
>
> Can you help me?

It's not clear what your goal here is, but there are a number of errors in
your script that are compounding the problem.

The first problem (not really an error, just something to avoid):
>    set FoldersList to "" as string

Is this a list or a string? Don't create variable names that imply a 'list'
object unless it is a list. It will get confusing later on.

The real problem lies in:

>        set FoldersList to name of i

So now 'FoldersList' is a string... nothing more than a series of
characters, so when you:

>        tell FoldersList

You're telling a string to do something...
And when you:

>            repeat with z in folder of FoldersList

You're trying to loop through the folders of a string. Can't do that.
Strings don't have folders. Hence the error.

If you're trying to get folders of an existing folder, then you have to pass
in a folder object, like:

>            repeat with z in folder of folder FoldersList

Or, better yet don't set FoldersList to the name of the folder, set it to
the folder itself:

tell application "Microsoft Entourage"
    repeat with topFolder in every folder
        repeat with subFolder in (folders of topFolder)
            set subFolderName to name of subFolder
        end repeat
    end repeat
end tell

I'm guessing there's more you want to do with this script, since the script
will only return the last subfolder found, but that's another story.

Andrew
:)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >subfolder in entourage (From: Giampiero Cairo <email@hidden>)

  • Prev by Date: Re: AppleScript a miserable and utter failure
  • Next by Date: Creating Nested Folders
  • Previous by thread: Re: subfolder in entourage
  • Next by thread: make a new folder within an exisitng folder
  • Index(es):
    • Date
    • Thread