Is it possible to get the directory that this patch is operating in:

Apr 12, 2011 at 3:50pm

Is it possible to get the directory that this patch is operating in:

Is it possible to get the directory that this patch is operating inside another? My idea is to get the path of the parent patch, if this patch is an object embedded in another patch?

#56272
Apr 13, 2011 at 6:46am

You could use javascript with the [js] object, here’s some code that should work:

function bang() {
    if (this.patcher.parentpatcher) {
        outlet(0,this.patcher.parentpatcher.filepath);
    }
}
#201917
Apr 13, 2011 at 11:43am

Thanks but how you manage the inlet and outlet with this script ?

#201918
Apr 13, 2011 at 10:35pm

By default you don’t have to declare inlets or outlets in javascript. It will default to one of each and the bang() function will fire when you send one to the one inlet it instantiates with. The first argument in the outlet(0,"whatever") line sends it to the first outlet. Do you want to have more inlets/outlets in the [js] object and what do you want them to do? Or have I misunderstood something?

#201919
Apr 14, 2011 at 3:10pm

I try this idea but it’s not working .

#201920

You must be logged in to reply to this topic.