tell application "AppleScript Editor" activate set myString to contents of document 1 set beforeList to {"%", ASCII character (9), ASCII character (13), ASCII character (13), ASCII character (32), ASCII character (34), "&", "<", ">", "\\", "\""} set afterList to {"%25", "%09", "%0a", "%0a", "%20", "%22", "%26", "%3c", "%3e", "\\\\", "\\\""} set html1 to "\n
\n\n\n\n\n\n\n\n\n" set oldDel to text item delimiters of AppleScript set i to 1 repeat with x in beforeList set text item delimiters of AppleScript to x set mylist to every text item of myString set text item delimiters of AppleScript to item i of afterList set myString to mylist as string set i to i + 1 end repeat set text item delimiters of AppleScript to oldDel set myString to html1 & "applescript://com.apple.scripteditor?action=new&script=" & myString & html2 set the clipboard to myString end tell my message("クリップボード", "AppleScriptをURLに変換して、セットしました。") on message(title, msg) try do shell script "/usr/local/bin/growlnotify " & title & " -m " & quoted form of msg on error activate display alert msg giving up after 1 end try end message