StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Copy List of Action Usage to Clipboard
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
This script will go through all of your applications and actions, building a list of each and how many times it's been used. This is just for fun and to demonstrate working with the settings object directly. Code://Array to hold values
var tuples = [];
//Loop through all applications defined in StrokesPlus.net and build action/count list:
for(i=0;i<sp_config.Applications.Count;i++){
for(j=0;j<sp_config.Applications[i].Actions.Count;j++){
tuples.push([sp_config.Applications[i].Description + ' \\ ' + sp_config.Applications[i].Actions[j].Category + ' \\ ' + sp_config.Applications[i].Actions[j].Description, sp_config.Applications[i].Actions[j].MatchCount]);
}
}
//Loop through all global actions and build action/count list:
for(j=0;j<sp_config.GlobalApplication.Actions.Count;j++){
tuples.push([sp_config.GlobalApplication.Description + ' \\ ' + sp_config.GlobalApplication.Actions[j].Category + ' \\ ' + sp_config.GlobalApplication.Actions[j].Description, sp_config.GlobalApplication.Actions[j].MatchCount]);
}
//Sort array
tuples.sort(function(a, b) {
a = a[1];
b = b[1];
return a < b ? -1 : (a > b ? 1 : 0);
});
//Build output string and copy to clipboard
var output = "";
for (var i = tuples.length-1; i >= 0; i--) {
output += tuples[i][1] + ' - ' + tuples[i][0] + '\r\n';
}
clip.SetText(output);
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Copy List of Action Usage to Clipboard
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close