Re: String manip: from AppleScript to shell
Re: String manip: from AppleScript to shell
- Subject: Re: String manip: from AppleScript to shell
- From: Michelle Steiner <email@hidden>
- Date: Tue, 28 Jan 2003 20:06:16 -0700
On Tuesday, January 28, 2003, at 04:45 PM, Philippe GRUCHET wrote:
-- string manipulation: swaps two words (here, space separated)
set {aString, text item delimiters} to {"Apple Script", space}
aString's text item 2 & space & aString's text item 1 --> "Script
Apple"
-- eos
From: Ivan Andrus <email@hidden>
-- string manipulation: swaps two words (here, space separated)
set aString to "Apple Script"
do shell script "perl -e 'print(join \" \", reverse split /\\s+/, \""
& aString & "\");'"
--> "Script Apple"
-- eos
In straight applescript:
set aString to "Apple Script"
set {tid, text item delimiters} to {text item delimiters, space}
set aString to (reverse of text items of aString) as text
set text item delimiters to tid
aString
--> "Script Apple"
--
"There's some good in the world, Mr. Frodo, and it's worth fighting
for."
_______________________________________________
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.