• 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: (resend)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (resend)


  • Subject: Re: (resend)
  • From: Thomas Fischer <email@hidden>
  • Date: Tue, 30 Mar 2010 18:59:31 +0200

Hi Alex,

for lack of control, words are a bad choice (it took me quite some time to find out what words are in HyperCard – which in general was as friendly as they come).
What's bothering you is the format of your input, so I tried to replace all runs of spaces with a single Tab and used that as text item delimiter.
And since there are no regular expressions in AppleScript (unless you use Satimage.osax, which is a good idea anyway), this is easiest done on the command line.

set myFolder to choose folder with prompt "Please select Folder"
set myShellString to "ls -tl " & (quoted form of POSIX path of myFolder) & " | grep '^d'|sed -E s/' +'/'\t'/g"
set myShellResults to do shell script myShellString as string
log myShellResults
set AppleScript's text item delimiters to tab
set myItems to number of text items in paragraph 1 of myShellResults
log paragraph 1 of myShellResults
log myItems

repeat with myItemIndex from 1 to myItems
	log text item myItemIndex of paragraph 1 of myShellResults
end repeat

display dialog "yo"

I hope the result is closer to what you need.
Thomas


Am 30.03.2010 um 08:44 schrieb Alex Zavatone:

>
> On Mar 30, 2010, at 1:31 AM, Shane Stanley wrote:
>
>> On 30/3/10 4:45 PM, "Alex Zavatone" <email@hidden> wrote:
>>
>>> Ok.  I come from the world of "one space or twenty thousand spaces between two
>>> words still means that you still have two words".
>>
>> Which is what happens in AS.
>
> I tried that.
>
> It's almost 2 am.  I'll get back to this tomorrow.
>
> _______________________________________________
> 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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: (resend) (From: Shane Stanley <email@hidden>)
 >Re: (resend) (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
  • Next by Date: Read/Write Text Files
  • Previous by thread: Re: (resend)
  • Next by thread: Re: (resend) - $ dir=/Some/Path/To/Server ; y=`date +%Y`; ls -lR $dir | sed -e "s/[0-9]*:[0-9]*/ `echo ${y}`/g"
  • Index(es):
    • Date
    • Thread