I would like to give a description on how the GUID on the tree items works. Hopefully this at some point be a replacement for the XmlIdLink that is used when manipulating a tree item from an action.
In case you have not seen this but if you add the action to Disable a folder/macro/action/plugin then you copy the action as python and paste it into a script you will see the following
Code: Select all
eg.plugins.EventGhost.DisableItem(XmlIdLink(4))
the above line cannot be executed from a python script or command. this is due to the fact that XMLIdLink is a string representation of a class that really does not exist. it is a pointer to a dynamically created TreeLink object and that object is not callable and XMLIdLink as a name has no reference to TreeLink in any way and is also not in the __builtin__ module.
so what I have done is created a new eg class called eg.GUID. and what this class does is issues out unique GUID's to tree items if it doesn't have one. it will create GUID's for all existing tree items as well as any newly created ones so you will experience a save eventghost even if you didn't change a thing. this is because it has added all of the GUID's and wants to save them in the EG save file. so this is not a bug it's by design.
if you have a need to use any of the actions that utilize the XmlIdLink and would like to have the ability to run those from a script you will have to open the EG save file and locate the item you wish to control via an action. if you have an extensive tree then it would be easiest to add an action dealing with that item copy the action as python. paste it into a script and get the number from it. then search you EG save file for id="THE_NUMBER" and you should be able to locate the GUID for that item it will be XML_GUID="{SOME_GUID}". copy only the quoted GUID (braces and quotes also) then go back to your script and delete the XmlIdLink() and put in it place eg.GUID(PASTE_HERE) in it's place. paste the copied GUID into the PASTE_HERE and you can now run the script "blacklisted" actions from a script.
Code: Select all
eg.plugins.EventGhost.DisableItem(eg.GUID("{AA41EA4C-A3B0-4480-A230-C471107BF597}"))
this is the first step so I want to make sure issuing the GUID's works 100% and that those of you that use the GUID's in a script do not have any kind of a problem. the TreeLink class in EG is extremely nested into the code. and is going to take some time to alter or remove. and that is also if it is decided that the XmlIdLink is going to be depreciated