DXL scripting to act on highlighted steps?

Just wondering if this can be done in a DOORs script. Highlight multiple steps and run a dxl script on only those highlighted steps.

I have created a script that works on sections only, based on header settings.

I wish to expand this to allow for selected lines in a step, highlighting them similar to the way that these steps can be highlighted from point A to point B, and then copied into another section of the module.

Thanks for any suggestions.
Gedinfo - Mon Mar 28 14:50:59 EDT 2011

Re: DXL scripting to act on highlighted steps?
llandale - Mon Mar 28 15:17:54 EDT 2011

Are you saying you want the user to highlight several Objects and then run a DXL that ignores all the others? Sure, "isSelected(obj)" used inside a big object loop will do that.

Object obj, oCurr = current   

for obj in entire(current Module) 

do 
{  

if (isDeleted(obj))      

continue 

if (obj == oCurr)    print identifier(obj) 
"\tis Current\n" 

if (isSelected(obj)) print identifier(obj) 
"\tis Selected\n" 
}

  • Louie

Re: DXL scripting to act on highlighted steps?
Gedinfo - Mon Mar 28 15:27:33 EDT 2011

Thank you very much, Louie.

This is what I am looking for.

I asked here because I could not find these functions by searching in DXL help.

Re: DXL scripting to act on highlighted steps?
llandale - Mon Mar 28 17:37:21 EDT 2011

Gedinfo - Mon Mar 28 15:27:33 EDT 2011
Thank you very much, Louie.

This is what I am looking for.

I asked here because I could not find these functions by searching in DXL help.

Well, now that you CAN find that function in the DXL manual you might as well read it and its sibling DXL commands, which will make more sense now that you can see what this command does. Had you done that 3 months ago you may have gotten the notion to search for "selected" and would have found it.

This takes advantage of the learning principle that its easier to understand something when you already have something similar to hang it on.

  • Louie

Re: DXL scripting to act on highlighted steps?
llandale - Mon Mar 28 17:45:33 EDT 2011

llandale - Mon Mar 28 15:17:54 EDT 2011
Are you saying you want the user to highlight several Objects and then run a DXL that ignores all the others? Sure, "isSelected(obj)" used inside a big object loop will do that.


Object obj, oCurr = current   

for obj in entire(current Module) 

do 
{  

if (isDeleted(obj))      

continue 

if (obj == oCurr)    print identifier(obj) 
"\tis Current\n" 

if (isSelected(obj)) print identifier(obj) 
"\tis Selected\n" 
}

  • Louie

Click a single object and run this DXL. The object will of course be "Current" but IIRC it is NOT also "Selected". If so, your script will likely need to accept an object if it's current OR selected.

For whatever its worth, there is also a "Object lastSelectedObject_()" command, not in the manual, which tells you which object was last clicked on by the user; IIRC returns null if that object is in a module now closed. I used that in a "Bookmark" script I wrote, and in this disasterous suite of scripts that kept changing the current object and I needed to figure out how to go "back home".

  • Louie