targeting basics
First let me appologize for what will seem a very basic question, but I am new to InDesign and Scripting and just had this project laid on me, and I can't seem to get my head around it.
Lets say I have 4 pages in a document.
Page 1 has 1 textframe
Page 2 has 2 textframes
Page 3 has 3 text frames
Page 4 has 4 text frames
Does using myInDesign.Documents.Item(1) target a page, a document, or a textframe?
Does using myInDesign.Pages.Item(1) target a page, or a textframe?
How do I target Page 2?
How do I target Textframe 3 on page 4?
Next, how do I target XML Nodes. For example using the example XML from Adobe I have something like this:
<code>
<devices>
<device>
<name>Pulse/Triangle Voltage Controlled Oscillator</name>
<type>VCO</type>
<part_number>DS001</part_number>
<supply_voltage>
<minimum>3</minimum>
<maximum>18</maximum>
</supply_voltage>
<package>
<type>DIP</type>
<pins>16</pins>
</package>
<price>3.25</price>
<description>A wide range, temperature-compensated voltage controlled ocsillator featuring 1 volt per octave exponential response. Pulse and triangle waveform output.</description>
</device>
<device>
<name>MultiWave Voltage Controlled Oscillator</name>
<type>VCO</type>
<part_number>DS002</part_number>
<supply_voltage>
<minimum>3</minimum>
<maximum>15</maximum>
</supply_voltage>
<package>
<type>SOIC</type>
<pins>18</pins>
</package>
<package>
<type>DIP</type>
<pins>18</pins>
</package>
<price>3.79</price>
<description>A wide range, temperature-compensated voltage controlled ocsillator featuring 1 volt per octave exponential response. Pulse, triangle, and sine waveform output.</description>
</device>
</devices>
</code>
If I target myDocument.XMLElements.Item(1) I all the data in all the nodes, but if I try this: myDocument.XMLElements.Item(2) I get an error saying it doesn't exist.
So my question is, what is the best way to get the value of a node in the tree, for instance "<part_number>"?
thanks in advance