• 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: do shell script & freeeeeze!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script & freeeeeze!


  • Subject: Re: do shell script & freeeeeze!
  • From: julifos <email@hidden>
  • Date: Wed, 26 Feb 2003 18:47:03 +0100

> On 25/2/03 21:23, "julifos" <email@hidden> wrote:
>
>> I was looking a one-line script to check whether an item is a file or a
>> folder, then (if folder) list its contents.
>>
>> ####################################
>>
>> set I_dont_know_if_is_folder to posix path of alias "HD:I am a file"
>>
>> do shell script "cd '" & I_dont_know_if_is_folder & "'; ls -R"
>
> How about:
>
> set x to posix path of alias "HD:I am a file"
> do shell script "if [ -d " & x & " ]; then ls -R " & x & " ;fi"
>
> Literally "if x is a directory, list it recursively.
>
> HTH,
>
> Nigel

Cool thanx! Definitivelly, I must learn a bit of shell scripting ;-)

JJ
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
_______________________________________________
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: Open a Movie from AppleScript?
  • Next by Date: Re: Safari - Clear History Cache
  • Previous by thread: Re: do shell script & freeeeeze!
  • Next by thread: Suggestions for speeding up code
  • Index(es):
    • Date
    • Thread