Action

Drafts Action Shortcuts

Posted by sylumer, Last update about 4 years ago - Unlisted

Dump details of all actions with shortcuts out to a new draft.

Steps

  • includeAction

    name
    TAD
  • script

    //Initialise
    let aactAll = [];
    let astrOutput = [];
    
    //Get all actions
    let aactgrpAll = ActionGroup.getAll();
    aactgrpAll.forEach(function(actgrpCurrent){aactAll = aactAll.concat(actgrpCurrent.actions);});
    
    //Process each action
    aactAll.forEach(function(acCurrent)
    {
    	//Process the install URL
    	let strLink = acCurrent.installURL.replace("drafts5://action?data=","");
    	strLink = decodeURIComponent(strLink);
    	let jsonData = JSON.parse(strLink);
    
    	//If we can find any shortcut data, add the details to the output list
    	if (jsonData.hasOwnProperty("keyCommand"))
    	{
    		let strShortcut = tadMisc.TA_actionKeys(jsonData.keyCommand);
    		if (strShortcut != "") astrOutput.push(`${acCurrent.name}: ${strShortcut}`);
    	}
    });	
    
    //Dump the output to a new draft
    draft.TA_draftNew(astrOutput.join("\n"));

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.