Problem with using GetPluginCaption

I am having a problem returning GetPluginCaption(Instrument_2) … getting a syntax error. Please see the compilation of my Scriptlet. Ultimately, I want to place the name on a PluginBlock on my widget “Instrument_2_Name”

GetPluginCaption_Qustion.rackspace (35.7 KB)

You cannot reference a plugin or widget in a scriptlet

The same issue as you already posted in
Declaring variables in loops and concatenating function outputs inline

Sure - I knew that. LOL!

But, How can I get the name of a PluginBlock and then display it on my panel?

That is very easy, but why use a scriptlet?

Use this in the rackspace script

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   Instrument_2 : PluginBlock
   Instrument_2_Name : Widget
   MyString : String
//$</AutoDeclare>


on Activate
 MyString = GetPluginCaption(Instrument_2)
 SetWidgetLabel(Instrument_2_Name, MyString)
end

I’m not quite sure what you’re building but it sure sounds like you should be writing a C++ extension using the GP SDK.

So, you are telling me that the Rackspace Script can reference a widget directly while a Scriptlet cannot? If so, that changes a lot for me. :slight_smile:

I am just a beginner … but once I figure out my DIVISI Chord Matrix, I will publish a very cool DIVISI Rackspace to the Community. Probably about another week or so as I am starting to get the hang of GP Script. :slight_smile:

In the discussion below there was the same mixup about the nature of scriptlets and it confirms your conclusion: