Created
September 15, 2010 16:18
-
-
Save ptigas/580985 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
--Applescript direct | |
on replaceText(find, replace, subject) | |
set prevTIDs to text item delimiters of AppleScript | |
set text item delimiters of AppleScript to find | |
set subject to text items of subject | |
set text item delimiters of AppleScript to replace | |
set subject to "" & subject | |
set text item delimiters of AppleScript to prevTIDs | |
return subject | |
end replaceText | |
set replacedText to the content of the selection of the front document | |
set replacedText to replaceText("For","\\textbf{For}", replacedText) | |
set replacedText to replaceText("To","\\textbf{To}", replacedText) | |
set replacedText to replaceText("Do","\\textbf{Do}", replacedText) | |
set replacedText to replaceText("End","\\textbf{End}", replacedText) | |
set replacedText to replaceText("If","\\textbf{If}", replacedText) | |
set replacedText to replaceText("Else","\\textbf{Else}", replacedText) | |
tell application "TeXShop" to set the selection of the front document to replacedText |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[Latex] Emhasize \textbf{} algorthim keywords in selected text in TexShop OSX.