Re: (resend)
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