Created
May 19, 2012 03:03
-
-
Save azur256/2728797 to your computer and use it in GitHub Desktop.
Replace more tag.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "MarsEdit" | |
try | |
set currentWindow to document 1 | |
on error errorMessage | |
display dialog ("Error: window are not opened.") buttons {"OK"} default button "OK" with icon caution | |
return | |
end try | |
set currentTextView to current text of currentWindow | |
if (currentTextView is "") then | |
display dialog ("No text") buttons {"OK"} default button "OK" with icon caution | |
return | |
else | |
set orig_delimiter to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to "<a name='more'></a>" | |
set tmp_list to every text item of currentTextView | |
set AppleScript's text item delimiters to "<!--more-->" | |
set target_text to tmp_list as string | |
set AppleScript's text item delimiters to orig_delimiter | |
end if | |
set current text of currentWindow to target_text | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment