Newbie Question - Replacing spaces with underscores
Newbie Question - Replacing spaces with underscores
- Subject: Newbie Question - Replacing spaces with underscores
- From: Josh Tishhouse <email@hidden>
- Date: Tue, 5 Jan 2010 10:04:21 -0500
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?
set theCalendar to "Calendar_Name" tell application "iCal" activate set theEvent to the last event of calendar theCalendar set textToParse to name of theEvent <parse the text>
Thanks in advance for your assistance. Sorry if this has been answered in the past, I couldn't find it in the archives.
Best,
Josh Tishhouse |
_______________________________________________
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