Name

action await power state, actionawaitpowerstate, kPMActionActionAwaitPowerState — Wait for the source of power to change.

Synopsis

action await power state structure { type, now, before, filter };
type : string, choice
now : string, choice, optional
before : string, choice, optional
filter : power source filter structure, optional

Description

Wait for the source of power to change.

The next action will not be performed until the power source changes.

Fields

type. Type of action to perform.

type is a string. type must be await power state, kPMActionType_AwaitPowerState.

now. New state of the power source.

now is a string. now is optional. now must be one of the following four constants:

  • off line, kPMActionNow_OffLine.
  • ac power, kPMActionNow_AcPower.
  • battery, kPMActionNow_Battery.
  • unknown, kPMActionNow_Unknown.

before. Previous state of the power source.

before is a string. before is optional. before must be one of the following four constants:

  • off line, kPMActionBefore_OffLine.
  • ac power, kPMActionBefore_AcPower.
  • battery, kPMActionBefore_Battery.
  • unknown, kPMActionBefore_Unknown.

filter. Power sources to monitor.

filter is a power source filter structure. filter is optional.