Skip to content

Debug prompt

Bennett Blodinger edited this page Mar 18, 2017 · 1 revision

Prompting the User for a Response

  • debug.prompt(message, defaultResponse, callback)
  • def callback(response)

Brings up a prompt with a message and defaultResponse, and attaches it to the document window that the script is running inside. When the user responds, the callback is invoked with their response, or None if the user cancels the prompt. This operation is asynchronous; i.e, debug.prompt will return before the callback is invoked.

A notification may also be delivered via macOS's Notification Center. The notification is only presented if Bit Slicer is in the background. If Bit Slicer is currently the frontmost application, then the notification will be delayed for a several number of seconds. If the notification is presented and the user is running macOS 10.9 or later, they can reply in the notification bubble. Note that in this case defaultResponse becomes a placeholder, and neither canceling or an empty response is a valid option.

After prompting, it may be desirable to activate the target (see debug.activate below).

Raises BufferError if the message or defaultResponse could not be parsed correctly.

Raises ValueError if callback is not callable.

Raises bitslicer.DebuggerError if the user already has a prompt to respond to that is attached to the current document window.

Available on version 1.7.5 or later.

Activating the Target

  • debug.activate()

Activates, or brings forward, the attached target so that it's active and in front of every other application. This will only work if the target is a user application, like a game. Returns True if activation is successful, otherwise False.

Available on version 1.7.5 or later.