Multiple Results in action script

(imported topic written by Shawn_Jefferson)

I’ve come across a few situations now where it would be nice to have a “foreach” actionscript relevance command. The latest issue is a program that I need to uninstall/remove that installs into a directory with a random string prepended to it, and the same thing for a service it creates (which doesn’t always get deleted by the uninstaller so I’m doing it manually). Some machines will have multiple of these, making the uninstall and cleanup quite annoying to script.

Is the only way around this currently to use the appendfile method and build a batch file?

(imported comment written by BenKus)

Hey Shawn,

Yea… we have been discussing this for 10+ years now since we first created actionscript…

The quick background is that we think that our other language, “Relevance”, is a next-generation language that we needed to develop because it was query-only, easy-to-use, flexible, easy-to-read, cross-platform, etc. and there really wasn’t any other language that would work… We still believe this and Relevance is an extremely valuable part of BigFix technology.

But Actionscript is fundamentally a basic scripting language that has no benefit over any other scripting language (PERL, Python, VBScript, sh, batch, etc.)… For this reason, we did not want to put any effort into building actionscript and we wanted it as bare-bones as possible and if you want to use another language or exe, then you can call it from actionscript…

So for years we didn’t even have an “IF” statement (which we brokedown and added in version 6)… and we discussed ways to embed another language (like Python) in the agent, but there were licensing and size issues that we never resolved…

I think it is time for us to discuss this again and figure out if we should implement while, for, foreach, pause, and other useful commands or if we should continue to be language purists and not try to reinvent scripting languages when so many other good options exist…

I will see if I can’t get together a discussion internally and follow-up with you guys about our latest conclusions.

Ben

(imported comment written by Shawn_Jefferson)

I agree that other scripting languages exist and we use them where appropriate, but I think that actionscript could benefit from a structure that could process “multiple results” relevance in a “foreach” manner-basically a simple loop structure. I don’t want to see actionscript get too bloated, but this seems like a problem screaming for a simple solution.

The other solutions are a bit ugly, involving an appendfile, or a concatenation and feeding that to an external script to parse.