Action

Select Action Group

Posted by Garbonsai, Last update about 1 month ago

UPDATES

about 1 month ago

  • Added switch to allow loading the selected action group into either the action list or the action bar

Prompt to select from a list of available Action Groups, and load the selected action group in the action list or action bar.

Steps

  • script

    // select from a list of workspaces and load
    let f = () => {
    
    	let groups = ActionGroup.getAll();
    	if ( groups.length == 0 ) {
    		alert( 'No action groups defined.' );
    		return false;
    	}
    	
    	let p = Prompt.create();
    	p.title = "Select Action Group";
    	p.addSwitch(
    		'list',
    		'Load into action bar instead of list',
    		false
    	);
    	for ( let g of groups ) p.addButton( g.name );
    	if ( !p.show() ) return false;
    
    	let group = ActionGroup.find( p.buttonPressed );
    	p.fieldValues[ 'list' ] ?
    		app.loadActionBarGroup( group ) :
    		app.loadActionGroup( group );
    }
    
    if ( !f() ) context.cancel();

Options

  • After Success Default
    Notification Error
    Log Level Error
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.