XAppProcess Reference

XAppProcess allows you to send key events to the application process specified with a bundle identifier.“keystroke” and “key code” commands of “System Events” can send key events only to the frontmost application process. But XAppProcess can send key events to any background processes.Also following oprerations to application processes are provided:activate an application process with detail options e.g. only one window is bring to the fronthide an application process without using “System Events”

Examples

use XAppProcess : script "XAppProcess"

set app_id to "com.apple.TextEdit"

tell XAppProcess's make_with({id:app_id, allow_launching:true})
post_keyevent("N", {"command"})
activate_with({all_windows:false})
delay 1
log hide()
log identifier() -- "com.apple.TextEdit"
log pid()
delay 0.1
log is_active() -- true
log is_hidden() --false
end tell

return missing value

Class Methods

activate_app

Activate specified application process with detail options

Constructor Methods

make_with

Return a new XAppProcess instance for an application process specified with a bundle identifier.

make_with_frontmost

Return a new XAppProcess instance for the frontmost application.

Hiding or Unhiding Applications

hide

Attempts to hide the application.

unhide

Attempts to unhide the application.

is_hidden

Indicates whether the application is currently hidden.

Activating Applications

activate_with

Activate the application process with detail options

activate

Indicates whether the application is currently hidden.

is_active

Indicates whether the application is currently frontmost.

Post Key Events to Applications

post_keyevent

Post a key event to the application

Obtain Information of the Application Process

identifier

Obtain an bundle identifier of the application process

pid

Obtain a process identifier of the applicatin process