[bugreport] this.patcher.filepath

Oct 5, 2007 at 10:46am

[bugreport] this.patcher.filepath

this.patcher.filepath only works in a javascript object that is located in the main patcher window. If you place the js object with the same script in a subpatcher, the attribute seems to return an empty string.

I suspect this might be a known issue, but I can’t find it in the archives.

(Windows 4.6.3)

-Thijs

#33984
Oct 7, 2007 at 12:00pm

this is the same for the thispatcher object itself. it doesn’t
report a filepath from a subpatch.
i think this is expected behavior? frankly, i’ve never liked it,
because it means i can’t hide the thispatcher object in a subpatch.

cheers
evan

On Oct 5, 2007, at 11:46 AM, Thijs Koerselman wrote:

>
> this.patcher.filepath only works in a javascript object that is
> located in the main patcher window. If you place the js object with
> the same script in a subpatcher, the attribute seems to return an
> empty string.
>
> I suspect this might be a known issue, but I can’t find it in the
> archives.
>
> (Windows 4.6.3)
>
> -Thijs
>

#113968
Oct 7, 2007 at 2:51pm

Quote: thijs.koerselman wrote on Fri, 05 October 2007 12:46
—————————————————-
> this.patcher.filepath only works in a javascript object that is located in the main patcher window. If you place the js object with the same script in a subpatcher, the attribute seems to return an empty string.
>
> I suspect this might be a known issue, but I can’t find it in the archives.
>
> (Windows 4.6.3)
>
> -Thijs
>
—————————————————-

I assume filepath is only available for patchers that are actually saved to disk, i.e. abstractions and top patchers.

To get the file path of the top patcher from inside a subpatcher you need to traverse up until you reach the top patcher and take the filepath property of that one..

Mattijs

#113969
Oct 7, 2007 at 4:38pm

> To get the file path of the top patcher from inside
> a subpatcher you need to traverse up until you reach
> the top patcher and take the filepath property of that one..

Ah of course. I guess this.patcher.parentpatcher.filepath will work then. I’ll give it a try.

Cheers,
-Thijs

#113970

You must be logged in to reply to this topic.