tell application "Internet Explorer" Activate set theString to my delChar(selected text, return) set tmpURL_http to my cropNext(theString, "ttp://") --- *ch 対応(笑) set tmpURL_ftp to my cropNext(theString, "ftp://") if tmpURL_http is not "" then set tmpURL to "h" & tmpURL_http else if tmpURL_ftp is not "" then set tmpURL to tmpURL_ftp else error number -128 end if end if set theURL to my get7bitChars(tmpURL) ---display dialog theURL --- debug用 OpenURL theURL end tell --- 文字列 theText から theChar を削除する on delChar(theText, theChar) set tmp to AppleScript's text item delimiters set AppleScript's text item delimiters to theChar set theList to every text item of theText set AppleScript's text item delimiters to "" set theText to theList as string set AppleScript's text item delimiters to tmp return theText end delChar --- 文字列 theText から、 theWord 以降末尾までの部分を抽出 on cropNext(theText, theWord) set tmp to AppleScript's text item delimiters set AppleScript's text item delimiters to theWord set theList to every text item of theText set theList to rest of theList set theText to theList as string set AppleScript's text item delimiters to tmp if theText is not "" then set theText to theWord & theText return theText end cropNext --- 7bit ASCII 文字が続く間は文字を拾う(半角空白は除外) on get7bitChars(theText) set x to "" repeat with curItem in theText if ((ASCII number (curItem)) < 33) or ((ASCII number (curItem)) > 128) then exit repeat end if set x to x & curItem end repeat return x end get7bitChars