tell application "mi" set konFile to file of the first document end tell try set widgetFile to refWidget(konFile) tell application "Konfabulator" to open widgetFile as alias on error try tell application "Konfabulator" to open konFile as alias on error display dialog "ファイルを Konfabulator で開けません。" with icon caution end try end try --http://homepage1.nifty.com/ton_b/AppleScript/Tips/String/FindReplace.html on refWidget(theFile) set tmp to AppleScript's text item delimiters set AppleScript's text item delimiters to ".widget" set theContainer to text from text item 1 to text item -2 of (theFile as string) set AppleScript's text item delimiters to tmp return theContainer & ".widget" end refWidget