On or near 1/1/01 7:03 PM, Aaron Sills at [EMAIL PROTECTED] observed:
> I think what needs to be done is for all the returns in the event to be
> replaced with non-breaking returns. Does anybody know if this is possible to
> do with the applescript or would I have to do it in Excel itself? Is it
> something to do with the text item delimiters, I�m not sure what they do?
>
With no comment on the rest of your script because I don't anticipate any
need to export events, here is how to replace returns in a text variable.
Assume the variable "t" contains the text you are working on:
set od to Applescript's text item delimiters
set Applescript's text item delimiters to return
set t to text items of t -- Makes a list containing all the fragments
between the return characters
set Applescript's text item delimiters to "" -- Empty string
set t to t as text -- Turns the list back into text, substituting a null
string where the returns used to be
For a more generic "search replace" routine, you can use this handler:
-- routine to do a search and replace on text
on SearchReplace(mainString, searchString, replaceString) -- Parameters:
search, replace, the String
set olddelis to AppleScript's text item delimiters
set AppleScript's text item delimiters to (searchString)
set theList to (every text item of mainString)
set AppleScript's text item delimiters to (replaceString)
set thestring to theList as string
set AppleScript's text item delimiters to olddelis
return thestring
end SearchReplace
Then, with that at the start or end of your script, to replace the returns
you would just do this:
set t to SearchReplace(t, return, "")
--
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984 <http://home.earthlink.net/~allenwatson/>
Applescripts for Outlook Express and Entourage:
<http://homepage.mac.com/allenwatson/>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>