AppleScript名:指定スクリプト書類の記述OSA言語を取得する v2 |
— Created 2017-06-04 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "OSAKit" set anAlias to choose file of type {"com.apple.applescript.script", "com.apple.applescript.script-bundle"} set sRes to getOSALangKindFromScriptFile(anAlias) of me –> {osaName:"AppleScript", osaDesc:"AppleScript.", osaVer:"2.5"} –> {osaName:"JavaScript", osaDesc:"JavaScript", osaVer:"1.1"} on getOSALangKindFromScriptFile(anAlias) set aURL to current application’s |NSURL|’s fileURLWithPath:(POSIX path of anAlias) set theScript to current application’s OSAScript’s alloc()’s initWithContentsOfURL:aURL |error|:(missing value) set scriptName to theScript’s |language|()’s |name|() as string set scriptDesc to theScript’s |language|()’s info() as string set scriptVer to theScript’s |language|()’s |version|() as string return {osaName:scriptName, osaDesc:scriptDesc, osaVer:scriptVer} end getOSALangKindFromScriptFile |
More from my site
(Visited 55 times, 1 visits today)