Get patcher name and insert it into a message box within the patcher?

EarHax's icon

I'm trying to insert the name of a patcher I am working on into a message box within the patcher itself. Is there some easy way to do this?

testcase's icon

do you mean the name of the file or the scripting name?

EarHax's icon

Found info in this post that helped me solve this.
https://cycling74.com/forums/retrieve-patcher-name

Max Patch
Copy patch and select New From Clipboard in Max.

parentname.js
js 0.25 KB
place in ~/Documents/Max 7/Library/code

testcase's icon

i use this as it gets scripting name if there is one

outlets=1;

function bang()
{
    if(this.patcher.box){
        outlet(0, this.patcher.box.varname);
    }
    else if(this.patcher){
        outlet(0, this.patcher.name);
    }
}