Re: Newbie Question - Replacing spaces with underscores
Re: Newbie Question - Replacing spaces with underscores
- Subject: Re: Newbie Question - Replacing spaces with underscores
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 5 Jan 2010 10:54:52 -0500
On Tue, Jan 5, 2010 at 10:25 AM, Luther Fuller <email@hidden> wrote:
> On Jan 5, 2010, at 9:04 AM, Josh Tishhouse wrote:
> 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)
Except Josh wanted to create a new variable with the underscore
version, not replace the original text.
To do that, just use a different name than "textVar" in the last "set"
statement. You can pick any variable name; the "set" statement will
create it.
--
Mark J. Reed <email@hidden>
_______________________________________________
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