Copy link to clipboard
Copied
How I can get names of all actions in some set?
If it is saved, you can get it from preferences.
...getAllAction() ;
function getAllAction() {
var res = [] ;
var pref = app.preferences ;
var path = 'plugin/Action/SavedSets/set-' ;
var currentPath, setName, actionCount, actions ;
for(var i = 1 ; i <= 100 ; i++) {
currentPath = path + i.toString() + '/' ;
// get setName
setName = pref.getStringPreference(currentPath + 'name') ;
if(!setName) {break ;}
// get actionNames
actions = [] ;
actionCount = Number(pref.getInteg
Copy link to clipboard
Copied
If it is saved, you can get it from preferences.
getAllAction() ;
function getAllAction() {
var res = [] ;
var pref = app.preferences ;
var path = 'plugin/Action/SavedSets/set-' ;
var currentPath, setName, actionCount, actions ;
for(var i = 1 ; i <= 100 ; i++) {
currentPath = path + i.toString() + '/' ;
// get setName
setName = pref.getStringPreference(currentPath + 'name') ;
if(!setName) {break ;}
// get actionNames
actions = [] ;
actionCount = Number(pref.getIntegerPreference(currentPath + 'actionCount')) ;
for(var j = 1 ; j <= actionCount ; j++) {
actions.push(pref.getStringPreference(currentPath + 'action-' + j.toString() + '/name')) ;
}
res.push({name: setName, actions: actions}) ;
}
return res ;
}
Copy link to clipboard
Copied
Thank you.
Copy link to clipboard
Copied
Sorry.
Doesn't work for me (without futher informations).
Your code only returns:
Ergebnis: [object Object],[object Object],[object Object],[object Object],[object Object]
Copy link to clipboard
Copied
alert(getAllAction()[0].actions.join('\r')) ;
/**
* get all action of preferences
* @return {Array} [{name: 'set1', actions: ['action1', 'action2'...]}...]
*/
function getAllAction() {
var res = [] ;
var pref = app.preferences ;
var path = 'plugin/Action/SavedSets/set-' ;
var currentPath, setName, actionCount, actions ;
for(var i = 1 ; i <= 100 ; i++) {
currentPath = path + i.toString() + '/' ;
// get setName
setName = pref.getStringPreference(currentPath + 'name') ;
if(!setName) {break ;}
// get actionNames
actions = [] ;
actionCount = Number(pref.getIntegerPreference(currentPath + 'actionCount')) ;
for(var j = 1 ; j <= actionCount ; j++) {
actions.push(pref.getStringPreference(currentPath + 'action-' + j.toString() + '/name')) ;
}
res.push({name: setName, actions: actions}) ;
}
return res ;
}