AppleScript名:指定パスのAppleScript書類がコンパイル済みかどうかチェック |
— Created 2014-12-16 by Takaaki Naganoya — 2014 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "OSAKit" property |NSURL| : a reference to current application’s |NSURL| property OSAScript : a reference to current application’s OSAScript –指定AppleScriptがコンパイルずみ(中間コードへの翻訳の意)かどうかをしらべる set a to (choose file of type {"com.apple.applescript.script-bundle", "com.apple.applescript.script", "com.apple.applescript.text"}) set asRes to chkAScompiled(a) as list of string or string –> true or false –指定のAppleScriptファイルがコンパイル(構文確認+中間言語化)ずみかどうかを取得する on chkAScompiled(anAlias as {alias, string}) set aURL to |NSURL|’s fileURLWithPath:(POSIX path of anAlias) set asO to OSAScript’s alloc()’s initWithContentsOfURL:aURL |error|:(missing value) try set compF to asO’s isCompiled() as boolean return compF on error return false end try end chkAScompiled |
More from my site
(Visited 54 times, 1 visits today)