Adobe 23101335 Scripting Guide - Page 26

JavaScript Debugging, running the JavaScript from the UI without holding down the modifier key.

Page 26 highlights

Scripting basics 2 Testing and troubleshooting 2.10.3 JavaScript Debugging This section describes the information and controls that the main Script Debugger window provides. In Photoshop you can use the JavaScript Debugger Window to step through your JavaScript code. JavaScript can be executed in two different ways: from the UI via the "Scripts..." menu and from AppleScript of VisualBasic via the do javascript methods. When running JavaScript from the UI you must hold down the option key on the Mac and alt on Windows to activate the debugger. When you hold down this modifier key the "Run Script" button changes to "Debug Script". When invoking JavaScript from AppleScript or VB you must set the show debugger argument appropriately. If you set show debugger to never you will disable debugging. This corresponds to running the JavaScript from the UI without holding down the modifier key. If you set show debugger to on runtime error your JavaScript will execute normally until it detects a run-time error or until it meets a "debugger;" call (see below for an example). When this happens execution will be stopped and the JavaScript debugger will be shown. If you set show debugger to at beginning your JavaScript will halt before executing the first line of JavaScript code and the debugger will be shown. This mode corrseponds to executing JavaScripts from the UI while holding down the modifier key. Photoshop 7.0 Scripting Guide 26

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91

Photoshop 7.0 Scripting Guide
26
Scripting basics
Testing and troubleshooting
2
2.10.3 JavaScript Debugging
This section describes the information and controls that the main Script Debugger window
provides.
In Photoshop you can use the JavaScript Debugger Window to step through your JavaScript
code.
JavaScript can be executed in two different ways: from the UI via the “Scripts...” menu and
from AppleScript of VisualBasic via the
do javascript
methods.
When running JavaScript from the UI you must hold down the
option
key on the Mac and
alt
on Windows to activate the debugger. When you hold down this modifier key the “Run
Script” button changes to “Debug Script”.
When invoking JavaScript from AppleScript or VB you must set the
show debugger
argument appropriately.
If you set
show debugger
to
never
you will disable debugging. This corresponds to
running the JavaScript from the UI without holding down the modifier key.
If you set
show debugger
to
on runtime error
your JavaScript will execute normally
until it detects a run-time error or until it meets a “debugger;” call (see below for an example).
When this happens execution will be stopped and the JavaScript debugger will be shown.
If you set
show debugger
to
at beginning
your JavaScript will halt before executing the
first line of JavaScript code and the debugger will be shown. This mode corrseponds to
executing JavaScripts from the UI while holding down the modifier key.