cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Georgios_Tsim
Level III

Send Expects Scriptable Object in access or evaluation of 'Send'

I have the following function that is called by another jsl file:

 

ConfirmFiltering = Function({},

show(dtImp);
dtImp << Select Where(!Contains(parameterChoice, :Parameter));


);

and even if the output of the show command is:

 

dtImp = DataTable("Details 2");

at the following line I get the following error:

Send Expects Scriptable Object in access or evaluation of 'Send' , dtImp << /*###*/Select Where( !Contains( parameterChoice, :Parameter ) ) /*###*/

 

It seems weird to me that even if recognizes the dtImp command as a DataTable, at the next line it characterizes that as a Not "Scriptable Object"

1 ACCEPTED SOLUTION

Accepted Solutions
Georgios_Tsim
Level III

Re: Send Expects Scriptable Object in access or evaluation of 'Send'

It was difficult to provide the full code, so I tried to describe and give part of them. However, I understand that is difficult for someone to to provide help if he/she is not able to see the full code. 

 

I found the solution. The problem was in the Main.jsl script that I provided above. In this script I had the following function which was called once the end user clicked on the button "Run Analysis":

 

compatStudyEval = Function({},
	// Function that is used to run the analysis script and handle landing page window

    // Run the analysis script related to this add-in
    Include( pathAddin || "\Analysis.jsl");

    // Close landing page 
win << close window;
    
);

The problem is generated by the win << close window; command which I included to close the main window.

 

I found the solution inspired by the following post:

Solved: Name Unresolved: Button in access or evaluation JMP Alert Message - JMP User Community

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Send Expects Scriptable Object in access or evaluation of 'Send'

It may be a scoping issue.  I suggest changing your reference to the :Parameter column to 

dtImp::Parameter

What is the value of the variable parameterChoice?

Jim
Georgios_Tsim
Level III

Re: Send Expects Scriptable Object in access or evaluation of 'Send'

The value of the parameterChoice is chosen by the end user of the add-in that I am trying to create.
It doesnt solve the problem and I think that the root is not in the Select Where command. Even if I use:

 dtImp << show window(1);

it gives the same error. It seems that it doesn't allow to use << operator to the DatatTble.

But to be more analytical. I have 2 scripts:

 

Main.jsl: Creates a window that gives the end user the capability to choose the dataset using a button

bboxImp = button box( "Select data to import", importData())

where the importData() function reads the data:

importData = Function({},
	// Function that is used to select which data to import for the analysis

    // Prompt the user to select input file
    importFile = Pick File( "Select Excel data to import" );

    if(importFile == "",
        // No file was selected - we skip the rest
        New window("Message", modal,
            Text Box("No file has been selected for import")
        ),
        // A file was selected - we continue
        // Import data
        dtImp = Open( importFile,
            Worksheets( "Details" ),
            Use for all sheets( 1 ),
            Concatenate Worksheets( 0 ),
            Create Concatenation Column( 0 ),
            Worksheet Settings(
                1,
                Has Column Headers( 1 ),
                Number of Rows in Headers( 1 ),
                Headers Start on Row( 31 ),
                Data Starts on Row( 32 ),
                Data Starts on Column( 1 ),
                Data Ends on Row( 0 ),
                Data Ends on Column( 0 ),
                Replicated Spanned Rows( 1 ),
                Replicated Spanned Headers( 0 ),
                Suppress Hidden Rows( 1 ),
                Suppress Hidden Columns( 1 ),
                Suppress Empty Columns( 1 ),
                Treat as Hierarchy( 0 ),
                Multiple Series Stack( 0 ),
                Import Cell Colors( 0 ),
                Limit Column Detect( 0 ),
                Column Separator String( "-" )
            )
        );

        // Select rows where "Component" column is empty
        dtImp << Select Where( Is Missing( :Name( "Component" ) ) );

        // Delete the selected rows
        dtImp << Delete Rows;

        // Grey out import botton and make Reimport and analysis botton available
        wait(1);
        dtImp << show window(0);  
        bboxImp << enable(0);
        bboxRe << enable(1);
        bboxAn << enable(1);
    );
);

ImportRedo = Function({},
	// Function that is used to remove imported datasets and allow for another import

    // Close imported datafile and ungrey import and analysis botton
    Close(dtImp, NoSave);
    bboxImp << enable(1);
    bboxRe << enable(0);
    bboxAn << enable(0);
);

 end then if you press the Run analysis button, it calls the Analysis.jsl script that creates a window where the end user makes some choices to filter the data choosing various unique values. In this script after the end user makes his choices I am trying to use:

ConfirmFiltering = Function({},

show(dtImp);
dtImp << Select Where(!Contains(parameterChoice, :Parameter));


);

to filter out the DataTable dtImp.

 

txnelson
Super User

Re: Send Expects Scriptable Object in access or evaluation of 'Send'

Is parameterChoice a scaler value such as "xxx" or is it a JMP list value {"xxx"}?  

 

In either case, if it is a single value, you might want to change the order of the Contains to

!Contains( :Parameter, parameterChoice )    
Jim
jthi
Super User

Re: Send Expects Scriptable Object in access or evaluation of 'Send'

Which JMP version are you using? Are you using application builder? How are you handling scopes and namespaces (we don't see full scripts so we are left to guesses)? Are you having these problems when you run it from .jsl files or after you have built it into an add-in? If you close your JMP session and run your script, do you have same issues on the first run?

-Jarmo
Georgios_Tsim
Level III

Re: Send Expects Scriptable Object in access or evaluation of 'Send'

It was difficult to provide the full code, so I tried to describe and give part of them. However, I understand that is difficult for someone to to provide help if he/she is not able to see the full code. 

 

I found the solution. The problem was in the Main.jsl script that I provided above. In this script I had the following function which was called once the end user clicked on the button "Run Analysis":

 

compatStudyEval = Function({},
	// Function that is used to run the analysis script and handle landing page window

    // Run the analysis script related to this add-in
    Include( pathAddin || "\Analysis.jsl");

    // Close landing page 
win << close window;
    
);

The problem is generated by the win << close window; command which I included to close the main window.

 

I found the solution inspired by the following post:

Solved: Name Unresolved: Button in access or evaluation JMP Alert Message - JMP User Community