You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pd->logMessage(tokens[2] + ": Select an object by ID or index. After selecting objects, you can send messages to them. Usage: " + tokens[2] + " <id> or " + tokens[2] + " <index>");
587
+
break;
588
+
589
+
casehash(">"):
590
+
casehash("deselect"):
591
+
pd->logMessage(tokens[2] + ": Deselects all on current canvas");
592
+
break;
593
+
594
+
casehash("ls"):
595
+
casehash("list"):
596
+
pd->logMessage(tokens[2] + ": Print a list of all object IDs on current canvas");
597
+
break;
598
+
599
+
casehash("find"):
600
+
casehash("search"):
601
+
pd->logMessage(tokens[2] + ": Search object IDs on current canvas. Usage: " + tokens[2] + " <id>.");
602
+
break;
603
+
}
604
+
}
547
605
casehash("?"):
548
606
casehash("help"):
549
607
{
@@ -558,18 +616,21 @@ class CommandInput final
558
616
if(tokens.size() == 2)
559
617
{
560
618
if(auto* cnv = editor->getCurrentCanvas()) {
561
-
for(auto* object : findObjects(cnv, target)) {
619
+
auto objects = findObjects(cnv, target);
620
+
for(auto* object : objects) {
562
621
cnv->setSelected(object, true);
563
622
cnv->updateSidebarSelection();
564
623
}
624
+
if(objects.empty()) pd->logError("No object found for: " + tokens[1]);
565
625
}
566
626
break;
567
627
}
568
628
569
629
tokens.removeRange(0, 2);
570
630
571
631
if(auto* cnv = editor->getCurrentCanvas()) {
572
-
for(auto* object : findObjects(cnv, target)) {
632
+
auto objects = findObjects(cnv, target);
633
+
for(auto* object : objects) {
573
634
if(auto* cnv = editor->getCurrentCanvas())
574
635
{
575
636
auto objPtr = object->getPointer();
@@ -590,6 +651,7 @@ class CommandInput final
590
651
}
591
652
}
592
653
}
654
+
if(objects.empty()) pd->logError("No object found for: " + tokens[1]);
593
655
}
594
656
}
595
657
@@ -783,6 +845,7 @@ class CommandInput final
783
845
"Command input allows you to quickly send commands to objects, pd or the canvas.\n"
784
846
"The following commands are available:\n"
785
847
"\n"
848
+
"- man <command>: print manual for command\n"
786
849
"- list/ls: list all object IDs in the current canvas\n"
787
850
"- search: search for an object ID in current canvas\n"
0 commit comments