Re: Newbie Question - Replacing spaces with underscores
Re: Newbie Question - Replacing spaces with underscores
- Subject: Re: Newbie Question - Replacing spaces with underscores
- From: Luther Fuller <email@hidden>
- Date: Tue, 05 Jan 2010 09:25:33 -0600
On Jan 5, 2010, at 9:04 AM, Josh Tishhouse wrote: Hi all. I'm a bit new at applescripting, so bear with me.
I'm using an applescript as an alarm in iCal. The Applescript also grabs information out of the iCal event, and saves it into strings. One of those is the Name of the event, which is, for instance, "Text With Spaces". I'd like to convert that into "Text_With_Spaces", essentially replacing the spaces with underscores. What's the best way to convert that, and set it as a new variable?
Here's how ... set textVar to "Text With Spaces" set AppleScript's text item delimiters to {space} set itemList to (text items of textVar) as list set AppleScript's text item delimiters to {"_"} set textVar to (itemList 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