Oops! I didn�t test quite thoroughly enough. If the listprefix is at the
beginning, you'll end up with a <space> at the start of the subject with
this:
> property listprefix : "[group]"
>
> tell application "Microsoft Entourage"
> set msg to item 1 of (get current messages)
>
> set temp to subject of msg
>
> if temp contains listprefix then
>
> set tid to AppleScript's text item delimiters
> set AppleScript's text item delimiters to listprefix
> set newdata to text items of temp
> set AppleScript's text item delimiters to ""
> set temp to text items of newdata as string
> set AppleScript's text item delimiters to " "
> set newdata to text items of temp
> set AppleScript's text item delimiters to " "
> set temp to text items of newdata as string
> set AppleScript's text item delimiters to tid
>
> set subject of msg to temp
>
> end if
> end tell
So use this slightly modified version instead:
property listprefix : "[group]"
tell application "Microsoft Entourage"
set msg to item 1 of (get current messages)
set temp to subject of msg
if temp contains listprefix then
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to listprefix
set newdata to text items of temp
set AppleScript's text item delimiters to tid
set temp to text items of newdata as string
set AppleScript's text item delimiters to " "
set newdata to text items of temp
set AppleScript's text item delimiters to " "
set temp to text items of newdata as string
set AppleScript's text item delimiters to tid
if character 1 of temp is " " then
set temp to characters 2 thru -1 of temp as string
end if
set subject of msg to temp
end if
end tell
George
--
George Clark - [EMAIL PROTECTED]
--
To unsubscribe: <mailto:Entourage-Talk-Off@;lists.letterrip.com>
archives: <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive: <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>