Adobe 23101764 Scripting Guide - Page 32

Visual Basic debugging

Page 32 highlights

Scripting basics 2 Debugging and Error Handling 2.10.2 Visual Basic debugging In Visual Basic, you can stop your script at any point, or step through your script one line at a time. To stop your script at a particular line, select that line in your script and choose "Debug > Toggle Breakpoint". When you run the script, Visual Basic will stop at the breakpoint you have set. Choose "Debug > Step Into" (or press F8) to execute the next line of your script, or choose "Run > Start" (or press F5) to continue normal execution of the script. You can also observe the values of variables defined in your script using the "Watch" window - a very valuable tool for debugging your scripts. To view a variable in the "Watch" window, select the variable and choose "Debug > Quick Watch". Visual Basic displays the "Quick Watch" dialog box. Click the "Add" button. Visual Basic displays the "Watch" window. If you have closed the "Watch" window, you can display it again by choosing "View > Watch Window." Check your Visual Basic documentation for more information. Windows Scripting Host also provides debugging information. For more information on using Visual Basic with Photoshop, see the VisualBasic Reference Guide on the installation CD. Photoshop CS Scripting Guide 28

  • 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
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105

Photoshop CS Scripting Guide
28
Scripting basics
Debugging and Error Handling
2
2.10.2
Visual Basic debugging
In Visual Basic, you can stop your script at any point, or step through your script one line at a
time. To stop your script at a particular line, select that line in your script and choose “Debug >
Toggle Breakpoint”.
When you run the script, Visual Basic will stop at the breakpoint you have set. Choose
“Debug > Step Into” (or press F8) to execute the next line of your script, or choose “Run
>
Start” (or press F5) to continue normal execution of the script.
You can also observe the values of variables de
ned in your script using the “Watch” window
— a very valuable tool for debugging your scripts. To view a variable in the “Watch” window,
select the variable and choose “Debug > Quick Watch”. Visual Basic displays the
“Quick Watch” dialog box. Click the “Add” button. Visual Basic displays the “Watch”
window. If you have closed the "Watch" window, you can display it again by choosing
“View > Watch Window.”
Check your Visual Basic documentation for more information. Windows Scripting Host also
provides debugging information. For more information on using Visual Basic with Photoshop,
see the VisualBasic Reference Guide on the installation CD.