• 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: Repeats with list of just 1 file not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repeats with list of just 1 file not working


  • Subject: Re: Repeats with list of just 1 file not working
  • From: Brett Conlon <email@hidden>
  • Date: Wed, 25 Apr 2007 10:07:02 +1100


Ahhh, I'm getting it now, thanks to Yvan, kai and you, Ed!

I like one liners, like "What do you call a lady with one leg? Peg" so I went with:

if the class of OutputFiles is not list then set OutputFiles to {OutputFiles}

Funny how such small things can stop you dead.... like viruses...

Cojcolds



"Stockly, Ed" <email@hidden>
Sent by: applescript-users-bounces+brett.conlon=email@hidden

25/04/07 04:38 AM

To
<email@hidden>
cc
Subject
Re: Repeats with list of just 1 file not working






>>>> Can a repeat process a list of just 1 file? It should, right???!!!
> >>>Things seem to work fine if there are 2 or more files in the folder but the
repeat seems to be skipped if there is only 1 file.

The problem is that in Finder (and a few other apps) if your command returns
a single item you get a reference to that item, but if it returns multiple
items you get a list of references to those items. Someone suggested using
alias list, which may not work in all cases.

Here's what I use, which seems pretty bulletproof:

If the class of myListOfFiles in not list then
set myListOfFiles to {myListOfFiles}
End if

HTH,

ES




 _______________________________________________
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

References: 
 >Re: Repeats with list of just 1 file not working (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Using the 'Create Archive' - File Menu Command
  • Next by Date: Re: Using the 'Create Archive' - File Menu Command
  • Previous by thread: Re: Repeats with list of just 1 file not working
  • Next by thread: Script to replace lost file extension
  • Index(es):
    • Date
    • Thread