So how does this look? Not going to add more than 2 Store containers. Are there ways to optimize it more?
Code: Select all
"_Initialize"
Perm $Selections;
Perm $Selections2;
Perm $SelectionStore;
If $SelectionStore == "" {
$SelectionStore = 1; }
"Add Selected Item(s)"
End ("<selitems>"==""),"Nothing Is Selected!";
$CountItems = Get("CountSelected");
If $SelectionStore == 2 {
$Selections2 = "$Selections2"."|".Get("SelectedItemsPathNames","|");
$Selections2 = FormatList("$Selections2","ned"); }
Else {
$Selections = "$Selections"."|".Get("SelectedItemsPathNames","|");
$Selections = FormatList("$Selections","ned"); }
Status "$CountItems Item(s) Added to Selection Store #$SelectionStore.",,"ready";
"Remove Selected Item(s)"
End ("<selitems>"==""),"Nothing Is Selected!";
$CountItems = Get("CountSelected");
Global $SelectionsRemove = Get("SelectedItemsPathNames","|");
If $SelectionStore == 2 {
ForEach($Item,$SelectionsRemove,"|") {
$Selections2 = Replace($Selections2,$Item,,1); }
$Selections2 = FormatList("$Selections2","ned"); }
Else {
ForEach($Item,$SelectionsRemove,"|") {
$Selections = Replace($Selections,$Item,,1); }
$Selections = FormatList("$Selections","ned"); }
Status "$CountItems Item(s) Removed from Selection Store #$SelectionStore.",,"alert";
""
"Edit Selection Store"
If $SelectionStore == 2 {
If $Selections2 > 0 {
$Contents2 = Replace($Selections2,"|","<crlf>");
$Selections2 = Input("Edit Selection Store #2",,$Contents2,m);
$Selections2 = Replace($Selections2,"<crlf>","|");
$Selections2 = FormatList("$Selections2","ned"); }
Else {
Status "No Item(s) in Selection Store #$SelectionStore.",,"alert"; } }
Else {
If $Selections > 0 {
$Contents = Replace($Selections,"|","<crlf>");
$Selections = Input("Edit Selection Store #1",,$Contents,m);
$Selections = Replace($Selections,"<crlf>","|");
$Selections = FormatList("$Selections","ned"); }
Else {
Status "No Item(s) in Selection Store #$SelectionStore.",,"alert"; } }
"Show Selection Store"
If $SelectionStore == 2 {
If $Selections2 > 0 {
Tag SelectionStoreItems,$Selections2,1;
Goto "*?Tags:SelectionStoreItems /r";
Tag SelectionStoreItems,$Selections2,1,2; }
Else {
Status "No Item(s) in Selection Store #$SelectionStore.",,"alert"; } }
Else {
If $Selections > 0 {
Tag SelectionStoreItems,$Selections,1;
Goto "*?Tags:SelectionStoreItems /r";
Tag SelectionStoreItems,$Selections,1,2; }
Else {
Status "No Item(s) in Selection Store #$SelectionStore.",,"alert"; } }
"Copy Store Item(s) to Clipboard"
If $SelectionStore == 2 {
If $Selections2 > 0 {
Copy $Selections2; }
Else {
Status "No Item(s) in Selection Store #$SelectionStore.",,"alert"; } }
Else {
If $Selections > 0 {
Copy $Selections; }
Else {
Status "No Item(s) in Selection Store #$SelectionStore.",,"alert"; } }
""
"Copy Item(s) to Here"
If $SelectionStore == 2 {
If $Selections2 > 0 == 1 {
CopyTo <curtab>,$Selections2; }
Else {
Status "No Item(s) in Selection Store #2.",,"alert"; } }
Else {
If $Selections > 0 == 1 {
CopyTo <curtab>,$Selections; }
Else {
Status "No Item(s) in Selection Store.",,"alert"; } }
"Move Item(s) to Here"
If $SelectionStore == 2 {
If $Selections2 > 0 == 1 {
MoveTo <curtab>,$Selections2; }
Else {
Status "No Item(s) in Selection Store #2.",,"alert"; } }
Else {
If $Selections > 0 == 1 {
MoveTo <curtab>,$Selections; }
Else {
Status "No Item(s) in Selection Store.",,"alert"; } }
""
"Clear Selection Store #1"
$Clear = Confirm("Are You Sure You Want To Clear Selection Store?");
End ($Clear == 0);
Unset $Selections;
Status "Selection Store Cleared!",,"alert";
"Clear Selection Store #2"
$Clear = Confirm("Are You Sure You Want To Clear Selection Store?");
End ($Clear == 0);
Unset $Selections2;
Status "Selection Store Cleared!",,"alert";
"Clear All Store"
$Clear = Confirm("Are You Sure You Want To Clear Selection Store?");
End ($Clear == 0);
Unset $Selections, $Selections2, $SelectionStore;
Status "All Cleared! Will Switch Back to Selection Store #1 at Next Start.",,"alert";
""
"Selection Store #1"
$SelectionStore = 1;
Msg "Selection Store #1 Selected.";
"Selection Store #2"
$SelectionStore = 2;
Msg "Selection Store #2 Selected.";