LSAPPINFO(8) | LSAPPINFO(8) |
lsappinfo - Control and query CoreApplicationServices about the app state on the system
lsappinfo [options] [ command [command options] ] ...
There are different ways to indicate what application the commands operate on, collectively called the app-specifier. This may be one of the following.
Any string from this set will map to the corresponding constant from the LaunchServices header files.
kCFBundleNameKey kLSASNKey kLSASNToBringForwardAtNextApplicationExitKey kLSAllowedToBecomeFrontmostKey kLSApplicationBackgroundOnlyTypeKey kLSApplicationBackgroundPriorityKey kLSApplicationCountKey kLSApplicationDesiresAttentionKey, kLSApplicationForegroundPriorityKey kLSApplicationForegroundTypeKey kLSApplicationHasRegisteredKey kLSApplicationHasSignalledItIsReadyKey kLSApplicationInStoppedStateKey kLSApplicationInThrottledStateAfterLaunchKey kLSApplicationInformationSeedKey kLSApplicationIsHiddenKey kLSApplicationListSeedKey kLSApplicationReadyToBeFrontableKey kLSApplicationTypeKey kLSApplicationTypeToRestoreKey kLSApplicationUIElementTypeKey kLSApplicationVersionKey kLSApplicationWasTerminatedByTALKey kLSApplicationWouldBeTerminatedByTALKey kLSArchitectureKey kLSBundleIdentifierLowerCaseKey kLSBundlePathDeviceIDKey kLSBundlePathINodeKey kLSBundlePathKey kLSCheckInTimeKey kLSDebugLevelKey kLSDisplayNameKey kLSExecutableFormatCFMKey kLSExecutableFormatKey kLSExecutableFormatMachOKey kLSExecutableFormatPoundBangKey kLSExecutablePathDeviceIDKey kLSExecutablePathINodeKey kLSExecutablePathKey kLSExitStatusKey kLSFileCreatorKey kLSFileTypeKey kLSFlavorKey kLSFrontApplicationSeedKey kLSHiddenApplicationCountKey kLSLaunchTimeKey kLSLaunchedByLaunchServicesKey kLSLaunchedByLaunchServicesThruForkExecKey kLSLaunchedByLaunchServicesThruLaunchDKey kLSLaunchedByLaunchServicesThruSessionLauncherKey kLSLaunchedInQuarantineKey kLSMenuBarOwnerApplicationSeedKey kLSModifierLaunchedForPersistenceKey kLSModifierRefConKey kLSNotifyBecameFrontmostAnotherLaunchKey kLSNotifyBecameFrontmostFirstActivationKey kLSNotifyLaunchRequestLaunchModifiersKey kLSOriginalExecutablePathDeviceIDKey kLSOriginalExecutablePathINodeKey kLSOriginalExecutablePathKey kLSOriginalPIDKey kLSPIDKey kLSParentASNKey kLSParentASNWasInferredKey kLSPersistenceSuppressRelaunchAtLoginKey kLSPreviousASNKey kLSPreviousPresentationModeKey kLSPreviousValueKey kLSRecordingAppleEventsKey kLSRequiresCarbonKey kLSSessionIDKey kLSShellExecutablePathKey kLSUIDsInSessionKey kLSUIPresentationModeAllHiddenValue kLSUIPresentationModeAllSuppressedValue kLSUIPresentationModeContentHiddenValue kLSUIPresentationModeContentSuppressedValue kLSUIPresentationModeKey kLSUIPresentationModeNormalValue kLSUIPresentationOptionsKey kLSUnhiddenApplicationCountKey kLSVisibleApplicationCountKey kLSVisibleApplicationListSeedKey kLSWantsToComeForwardAtRegistrationTimeKey launchedThrottled
Likewise, these short strings also make to the corresponding constants.
allowedtobecomefrontmost applicationTypeToRestore applicationWasTerminatedByTAL applicationtype arch asn bundleid bundlelastcomponent bundlename bundlenamelc bundlepath changecount creator debuglevel displayname execpath executablepath filecreator filename filetype hidden isconnectedtowindowserver isready isregistered isstopped isthrottled launchedForPersistence launchedinquarantine name parentasn pid presentationmode presentationoptions psn recordingAppleEvents session shellpath supressRelaunch version
In numerous places a key can be set to a value. The format of value can be any of the following
Notifications are sent out by LaunchServices when various conditions arrive. Each notification has a type, called the notification-code, a dictionary of data items which are specific to the notification, a time the notification was sent, and an optional affected ASN.
Sent when an application is launched
Sent when an entry for an application is created on the system and associated with an ASN.
Sent when an
Sent when an application exits.
Sent when an application exits with a non-zero exit status.
Sent when an application exits, with affected ASN set to the parent ASN of the application which exited.
Sent when an application exits with a non-zero exit status, with affected ASN set to the parent ASN of the application which exited.
Sent when an application launch fails, after a launch notification has been sent out.
Sent when an application is "created", which happens immediately after the application is created and certain items are added into the application information dictionary.
Sent when an application is "created", which happens immediately after the application is created and certain items are added into the application information dictionary, with affected ASN set to the asn of the parent ASN of this application.
Sent when an applications signals to LaunchServices that it is ready to accept hide/show events, generally when it has entered its main runloop.
Sent when an applications signals to LaunchServices that it is ready to accept hide/show events, generally when it has entered its main runloop, with affected ASN set to the parent ASN of the application which signalled ready.
Sent when an application signals that it is ready to accept AppleEvents.
Sent when talagentd decides that all applications which were launched for persistence have registered.
Sent when an application is made into the front application.
Sent when an application which previously was the front application is no longer the front application.
Sent when the front-to-back order of the application list changes.
Someone has requested that the application with affected ASN make itself frontmost.
Sent when the application which is responsible for drawing the menu bar (generally the frontmost foreground application) changes
Sent when the application which was responsible for drawing the menu bar (generally the frontmost foreground application) is no longer responsible
Sent when the application is hidden
Sent when the application is shown
Someone has requested that the application with the affected application asn should show (un-hide) itself.
Someone has requested that the application with the affected application asn should hide itself.
Someone has requested that the application with the affected application asn should show itself and pull all of its windows forward.
Sent when the information for the application is changed.
Sent when a key is added to the information for the application. The data for the notification will include the key being added and its value.
Sent when a value for an item in the application information is changed. The data for the notification will include the key being changes and its new and old value.
Sent when the value for an item in the application information is removed. The data for the notification will include the key being removed and its value.
Sent when the "ApplicationType" key in the application information is changed.
Sent when the application name in the application information is changed.
Sent when the LSWantsAttention key in the application information is changed.
Sent when an application changes its presentation mode.
Sent when an application changes its pid. In practice this can never happen, except when LaunchServices launches a process which itself forks or spawns a new process, and then checks-in from that new pid.
Sent when the presentation mode of the system changes, generally when the foreground application changes its own presentation mode or when the front application changes and the old and new applications have different presentation modes.
Sent when the presentation mode of the system changes only because the front application changed and the old and new applications have different presentation modes.
Sent when a formally stopped application is started.
Sent when the ASN of the session launcher application registers with LaunchServices.
Sent when the application registered as the session launcher unregisters or exits.
Sent when the meta-information item for the next application to bring forward ASN is changed
Sent when the system process (generally loginwindow) registers with LaunchServices.
Sent when the system process (generally loginwindow) unregisters with LaunchServices.
Sent when a front-reservation is created.
Sent when a front reservation is destroyed.
Sent when the array of permitted-front-applications changes.
Sent when an application changes its "LSSupressRelaunch" key.
Sent when an application changes its "TerminatedByTAL" key.
Sent when an application changes * applicationWouldBeTerminatedByTALChanged * applicationProgressValueChanged * applicationVisualNotification * wakeup
Request that the application with affected ASN resume running its main runloop.
Sent when a session is created, generally when the first application registers inside the session. Affected ASN is always NULL, since this does not refer to any particular application.
Sent when a session is destroyed. Affected ASN is always NULL, since this does not refer to any particular application.
This represents an invalid notification code, and is never sent.
This represents all notification codes, and is never sent, but gets used when specifying which notifications to listen for.
lsappinfo list
lsappinfo listen +all forever
lsappinfo listen +becameFrontmost wait 60
lsappinfo launch nofront=true async=true /Applications/TextEdit.app/
lsappinfo find bundleid=com.apple.TextEdit
lsappinfo find name="TextEdit"
lsappinfo info "TextEdit"
04/01/2013 |