Ent 2008 Remove text "AUGD: " from Subject
Ent 2008 Remove text "AUGD: " from Subject
- Subject: Ent 2008 Remove text "AUGD: " from Subject
- From: Geoff WALLACE <email@hidden>
- Date: Sat, 10 Jan 2009 09:20:50 +1100
- Thread-topic: Ent 2008 Remove text "AUGD: " from Subject
Hello All,
Need some help with a Script.
Have a script that removes [ ] from the Subject.
Opened in Script Editor and changed it to remove "AUGD: " from the Subject.
Script below.
"on run
tell application "Microsoft Entourage" --
set currentMessages to the current messages --
repeat with theMsg in the currentMessages --
set str to the subject of theMsg
set x to str -- Save for comparison
if str contains "AUGD: " then
-- Search for something like "AUGD: " at the start of the
subject, and strip it
-- Remove "AUGD: "
--Now remove the AUGD: "
set sd to AppleScript's text item delimiters
set AppleScript's text item delimiters to "AUGD: "
try
set temp to text items 2 thru -1 of str
set str to temp as text
on error
set str to "<No Subject>"
end try
set AppleScript's text item delimiters to sd
if "AUGD: " then
set str to str
end if
--Remove possible leading blank(s)
repeat while (character 1 of str is " ")
try
set str to text 2 thru -1 of str
on error
set str to "<No Subject>"
end try
end repeat
end if
-- If found, replace subject, otherwise leave subject alone
if str is not equal to x then
set subject of theMsg to str
end if
end repeat --
end tell --
end run"
The script compiles ok but on run in Script Editor, it errors with the
message "Cant make "AUGD: " into type boolean"
If I select a message in Ent and run the script, nothing seems to happen?
Any clues to solve the problem please.
Mac Pro with 2.66 GHz Dual core 2 Duo and 7 GB RAM running OS X 10.5.6 with
all Apple Updates installed.
--
Do you own or use an Apple Macintosh Computer?
If so at some time you will need the macfixer
<http://macfixer.com.au> Mob: 0412 056 033 Ph: 61 3 9893 1677
Geoff WALLACE
_______________________________________________
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