• 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: Weird...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird...


  • Subject: Re: Weird...
  • From: Nigel Garvey <email@hidden>
  • Date: Thu, 14 Mar 2002 02:25:07 +0000

mjn wrote on Wed, 13 Mar 2002 13:54:16 -0600:

>Neither of these seem to work:
>set aliasFileList to {(startup items folder)'s files, (desktop)'s files}
>or
>set aliasFileList to (desktop)'s files
>set aliasFileList's end to (startup items folder)'s files
>
>
>The script assigns them to the reference but when it tries to accessing the
>value, say with a repeat loop, all of the items added from the second
>location (either in desktop in the first example or startup items in the
>second one), fail. This is apparently because they are not being
>referenced properly (doc 1&2 are on the Desktop and doc 0 is in startup
>items):
>
>--> Can't get kind of {file "Document 1" of application "Finder", file
>"Document 2" of application "Finder"}

Each of the two Finder references - '(startup items folder)'s files' and
'(desktop)'s files'
- returns a list of the files concerned. When you:

set aliasFileList to {(startup items folder)'s files, (desktop)'s files}

... you're setting the variable 'aliasFileList' to a list whose items are
the two lists - not the files themselves. The files are contained in the
two lists:

aliasFileList = {{doc 0}, {doc 1, doc 2}}

Your error message is telling you that it's not possible to get the
'kind' of one of the lists. (You can only get the kind of the files.)

I can't duplicate the way you say your first example works. Your second
example works the way it does because you're getting a list of the
desktop files and inserting the list of startup item files at the end of
that.

aliasFileList = {doc 1, doc 2, {doc 0}}

Your best bet - if you want to loop through the files of the two folders
- is probably to concatenate the lists like this:

set aliasFileList to (startup items folder)'s files & (desktop)'s files
--> {doc 0, doc 1, doc 2}

NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: sending mail from an applescript
  • Next by Date: Re: Weird... (but quite logical really)
  • Previous by thread: Weird...
  • Next by thread: Error -2003 / QuickTime
  • Index(es):
    • Date
    • Thread