• 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
Re: varibles in handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: varibles in handler


  • Subject: Re: varibles in handler
  • From: Christopher Stone <email@hidden>
  • Date: Mon, 17 Jan 2011 19:01:01 -0600

On Jan 17, 2011, at 17:50, Robert Poland wrote:
Looks like we're fighting the wrong battle.  I think the issue is that the line
"set AppleScript's text item delimiters to newDelimiter" won't work with a variable is place of text.
______________________________________________________________________

Hey Bob,

Well crap.  I knew I should have hung onto your original post, and I can't refer to it now.  But...

In the first post you made about this the first line was:

my setDelimiters(originalDelimiters)

I put your whole script into Script Debugger and started stepping through it.  It balked on that first line - because you had not assigned 'originalDelimiters' a value before you make the handler call.

There is no problem setting TIDS via a variable, but the variable must have something in it.

on FIND_REPLACE(findText, replaceText, srcText)
set oldTIDS to AppleScript's text item delimiters
set AppleScript's text item delimiters to findText
set srcText to text items of srcText
set AppleScript's text item delimiters to replaceText
set srcText to srcText as text
end FIND_REPLACE

set someText to "Now is the time for all good men to come to the aid of their country."

set findText to "the"
set replaceText to "•"

FIND_REPLACE(findText, replaceText, someText)

--
Best Regards,
Chris
 _______________________________________________
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

References: 
 >varibles in handler (From: Robert Poland <email@hidden>)
 >Re: varibles in handler (From: Christopher Stone <email@hidden>)
 >Re: varibles in handler (From: Robert Poland <email@hidden>)
 >Re: varibles in handler (From: Christopher Stone <email@hidden>)
 >Re: varibles in handler (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: varibles in handler
  • Next by Date: Re: varibles in handler
  • Previous by thread: Re: varibles in handler
  • Next by thread: Re: varibles in handler
  • Index(es):
    • Date
    • Thread