[share code] How to programatically control the editor actions
-
https://gist.github.com/c9f42c81c53b276b6560
I stumbled across the NSUserDefaults (omz had used it for the theme editor) and noticed editor actions are there. Here is a set of utilities for adding or removing editor actions, programatically. (for instance, i am going to put in a pull request for stash to self install an editor action).especially useful since deleting an action through the menu seems to crash on my device anyway. Also, since you cannot tell the path from the action menu, this lets you check which copy of a script you are using.
-
Is it possible to programmatically add an action with arguments?
It seems to me that the UI for adding arguments is currently bugged in 2.0. You can add arguments, but they are NOT saved once you click "Done". It would be great to have a fix with your script.
-
Unfortunately, i don't know the key name for the arguments, since they are not being saved in 2.0 (anyone still have the beta? we could check there)
-
This post is deleted!last edited by
-
updated for beta 20100 with arguments
-
@JonB Thanks for the update.
It seems to me that an extra parameter is needed for function
add_action
to actually allow user specified arguments like the follows:def add_action(scriptName,iconName='python',iconColor='',title='', arguments=None):
I tested and it worked with 2.0.