Hi
I have a bunch of html files authomatically downloaded as feeds whose title is oddly screwed up with html tags, i.e.: part of the title another part
I’d like to automatically delete all this html tags and I’ve tried with the “replace text” script but it’s not possible to set the replate text to nothing.
To replace text with nothing, enter a single space in the “enter replacement text” dialog. If the “text to find” is at the beginning or end of the title the script will not put a space there, it will merely delete the text.
Thanks Korm,
I’m trying to modify the replace script but it returns no result. What am I missing?
tell application id "com.devon-technologies.thinkpro2"
try
set this_selection to the selection
if this_selection is {} then error "Please select some contents."
repeat
set search_string to "<em>"
--display name editor "Replace Text" info "Enter text to find:"
--if search_string is not "" then exit repeat
end repeat
set replacement_string to " "
--display name editor "Replace Text" info "Enter replacement text:"
set od to AppleScript's text item delimiters
repeat with this_item in this_selection
set current_name to name of this_item
if current_name contains search_string then
set AppleScript's text item delimiters to search_string
set text_item_list to every text item of current_name
set AppleScript's text item delimiters to replacement_string
set new_item_name to text_item_list as string
set the name of this_item to new_item_name
end if
end repeat
set AppleScript's text item delimiters to od
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell