<doc>
  <legacy_id>1243</legacy_id>
  <name>openProcessIDs</name>
  <type>function</type>
  <syntax>
    <example>the openProcessIDs</example>
    <example>openProcessIDs()</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>The System Environment</category>
  </classification>
  <references>
    <command tag="kill">kill Command</command>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
    <process/>
  </security>
  <summary><glossary tag="return">Returns</glossary> the <glossary tag="process">process</glossary> IDs of <glossary tag="process">processes</glossary> that have been opened with the <command tag="open process">open process</command> <glossary tag="command">command</glossary>, but have not yet <glossary tag="exit">exited</glossary>.</summary>
  <examples>
    <example>the openProcessIDs</example>
    <example>put last line of the openProcessIDs into previousProcessID</example>
  </examples>
  <description>
    <p>Use the <b>openProcessIDs</b> <control_st tag="function">function</control_st> to communicate with <glossary tag="process">processes</glossary> you have opened with the <command tag="open process">open process</command> <glossary tag="command">command</glossary>.</p><p/><p><b>Value:</b></p><p>The <b>openProcessIDs</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a list of <glossary tag="integer">integers</glossary>, one per <keyword tag="line">line</keyword>.</p><p/><p><b>Comments:</b></p><p>Certain Unix commands such as "kill" require a process ID. You can use these commands to act on processes you opened by using the <b>shell</b> <glossary tag="command">command</glossary>:</p><p/><p><code>  put "kill -9" &amp;&amp; line 1 of the openProcessIDs into whatToExecute</code></p><p><code/>  get shell(whatToExecute)</p><p/><p>On Mac OS and OS X systems, there is no process ID. Instead, the <b>openProcessIDs</b> function <glossary tag="return">returns</glossary> a list of <glossary tag="integer">integers</glossary>. The first application started up (with the <command tag="open process">open process</command> or <command tag="launch">launch</command> <glossary tag="command">command</glossary>) during a session is assigned the number 1, the second is assigned the number 2, and so on. After an application quits, its <glossary tag="process">process</glossary> number is not re-used, so you can use the <b>openProcessIDs</b> <control_st tag="function">function</control_st> to determine how many times LiveCode has started up an application during the current session.</p><p/><p>The list of process IDs is in the same order used by <b>openProcesses</b> <control_st tag="function">function</control_st>, which is the same order that the <glossary tag="process">processes</glossary> were opened.</p><p/><p>Programs that were not started by LiveCode are not included in the list returned by the <b>openProcessIDs</b> <control_st tag="function">function</control_st>.</p>
  </description>
</doc>