Re: (resend)
Re: (resend)
- Subject: Re: (resend)
- From: Alex Zavatone <email@hidden>
- Date: Tue, 30 Mar 2010 00:45:40 -0500
Ok. I come from the world of "one space or twenty thousand spaces between two words still means that you still have two words".
In yee olden days of yore, when fair maidens and dragons peppered this land of ours, I used this prehistoric Macromedia Director with yon Lingo language where you could say magical things like:
word 1 of my string
and
word 2 of my string
and so oneth
and for a string like "THIS IS A S:T-RING"
Words, 1, 2, 3 and 4eth would be:
THIS
IS
A
S:T-RING
Lingo also had an item delimiter, but just one, so we could pick items out of a string with skill and ease.
All in all, I'm a little spoiled by the language of my devonian past, where you could magically pick the actual word from the source, by index, no matter how many spaces or bizarre crud appears inside.
In the ls shell script example, some date info occasionally adds a colon in the date, resulting in yet another word, even though we are not sorting by magical elvish colons.
It makes the calm, placid and otherwise serene mind wobble with um, anger.
Words need to be delimited by spaces, no matter now many there are between the words.
Sweet mother of bacon. Text chunking should not be this hard.
- Grumble.
On Mar 30, 2010, at 12:33 AM, email@hidden wrote:
> Alex, are you trying to do something like this? (would require SL)
>
> set myFolder to alias "Macintosh HD:Users:edstockly:Desktop:BookTesting:"
>
> set myShellString to "ls -tl " & (quoted form of POSIX path of myFolder) & " | rep '^d'"
> set myDir to do shell script myShellString as string
>
> set AppleScript's text item delimiters to {" ", " ", " ", " ", " ", " ", " "}
> set myDir to every text item of myDir
> set AppleScript's text item delimiters to {" "}
> set myDir to paragraphs of (myDir as text)
> set myDates to {}
> repeat with thisGraph in myDir
> set the end of myDates to text items 5 thru 7 of thisGraph as text
> end repeat
> set AppleScript's text item delimiters to {return}
> log myDates as text
_______________________________________________
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