Get(X)Option and Set(X)Option don't work with the "name" option

Posted by Twisol on Fri 12 Feb 2010 06:36 PM — 3 posts, 9,762 views.

USA #0
(v4.48)

When using GetTriggerOption (and the like), passing "name" returns nil. When using SetTriggerOption (and the like), passing "name" returns 30025 ("Option name not found"). This is in contrast to the documentation for both, which lists "name" as a valid option.

Certainly Get(X)Option wuth "name" isn't very useful, but in regards to Set(X)Option I don't see any other way to rename a trigger/alias/timer from a script without exporting the whole thing, tweaking the name, and importing it back in. Renaming a trigger/alias/timer can be useful along the same lines as modifying one's group: the name acts as a reference to it, so you could manage a set of triggers and apply a single name to any one at a time, where the named trigger represents the "current" trigger.
Australia Forum Administrator #1
The documentation has been amended in the next release. As you say, you already know the name when getting the option, and the functions have really been provided for amending existing items, not renaming them.

If you could change the name there is a possibility of clashing with an existing one.

You would need to use ExportXML and then ImportXML.
USA #2
Fair enough, thanks.