Get patch file name [Sharing will follow]

Miguel's icon

Hi all,

I'm working on a large patch that loads a lot of other patches in a bpatcher. It is a kind of functional powerpoint substitute where instead of using MS PP for my slides I load different patchers and can execute stuff.

Each slide is a different patch and I have a presentation designer where I just drop the slides I will use in the desired order. This takes the names of the patches to keep track of current and next slides. At the moment each slide sends its filename when I hit next button. It works well but I need to manually change this each time I add a new slide.

My question is if there is a way to query the name of the file from within the patch itself so it tells me what is its name. Thus avoiding having to manually enter it each time I add or change the name of a slide.

I looked at [thispatcher] but I can only get whether or not it has a title but not the actual name of the loaded patcher.

Is there any message I can send to [thispatcher] or any other object to help me with this?

I am planning to release it once I get it to be stable enough

Thanks in advance

kennethstewart's icon

I haven't figured out how to query the filename of the open patcher, but once you do figure out how to do that here are a couple of [rexexp]s I use to extract the filename of a file that I regularly use with [opendialog] or [dropfile].

Best,

KS

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

`

EMV's icon

By sending "path" to thispatcher, you get the path where the patcher is saved.

I did the filename thing in javascript at work recently, which I'll post on monday when I have access to my work computer again.

spectro's icon

The example file "patchdescribe-example" in the directory: "examples/javascript/patcher-scripting" has a .js based example of the patcher outputting its name (among other things).

Miguel's icon

Spectro you da man!

This works perfect, although for some reason it outputs the patcher name over 20 times with a single bang. Already fixed it but it is weird.

Thanks lads, I will try to release my patch as soon as I can.

- Miguel

EMV's icon

Ah yeah, that's probably where I got my js version from too :)