FrontAccess
最前面のアプリケーションの取得、およびそのアプリケーションで開いている最前面のファイル参照を取得するモジュールです。
GUI Scripting を利用して、以下のことを簡単にできるようにします。
- 最前面のアプリケーションのさまざまな情報の取得
- 最前面のアプリケーションで開かれている最前面の書類のファイル参照の取得
- 最前面のアプリケーションで開かれている最前面の書類を保存して閉じること
特定のアプリケーションに依存せず、現在注目しているファイルを処理するスクリプトの作成に役に立ちます。
use FrontAccess : script "FrontAccess"
use GUIScriptingChecker : script "GUIScriptingChecker"
if not GUIScriptingChecker's do() then
return
end if
tell (make FrontAccess) -- Making an instance of FrontAccess
(* Obtain application name and file alias *)
log application_name()
log application_alias()
(* Obtain the file alias of the front document *)
log document_alias()
end tell
更新履歴
- 1.4.1 -- 2020-02-01
- OpenHelpBook.scptd is used to display a help book instead of HelpBook.osax.
- 1.4 -- 2017-02-09
- OS X 10.9 or later is required.
- URI Escape.osax is not required.
- ModuleLoader.osax is not required.
- SmartAcrivate.osax is not required.
- Added compatibility with AppleScript Libraries introduced in OS X 10.9.
- 1.3.1r2 -- 2014-10-01
- Fixed : the "edit" button of the sample code in the HelpBook does not work.
- 1.3.1 -- 2013-09-17
- Fixed : error of document_alias() with AppleScriptObjC.
- 1.3 -- 2012-06-13
- Added "check_osax".
- Improved the layout of the help book for small Help Viwer's windows.
- 1.2.1 -- 2010-09-10
- Fixed : Correct error does not raise when front window is not for the document.
- 1.2 -- 2010-08-09
- Added "main_window".
- 1.1.1 -- 2010-03-30
- Removed dependency on "ShowHelpBook"
- Improve coompattibility with some applications.
- 1.1 -- 2009-10-20
- Added method "bundle_identifier".
- Added method "is_current_application".
- Added method "set_keytype_emulation".
- Added method "paste_text".
- app_name() will return short name instead of disyplayed name.
- 1.0.2 -- 2009-04-29
- Fixed a problem when front window is not saved, second window is processed.
- When front window is not saved, error number 1751 will raise.
- 1.0.1 -- 2008-11-10
- Improved compatibility with Mac OS X 10.5.
- Added document_url().
- 1.0 -- 2008-04-20
- First release.