• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Newbie Question - Replacing spaces with underscores
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Newbie Question - Replacing spaces with underscores
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: Photoshop layer set
  • Next by Date: Re: Newbie Question - Replacing spaces with underscores
  • Previous by thread: Re: FileMaker 10
  • Next by thread: Re: Newbie Question - Replacing spaces with underscores
  • Index(es):
    • Date
    • Thread