Forums > MaxMSP

remove part of a path : syntaxe problem

January 31, 2008 | 2:08 pm

Hi there,

On OSX.

I need launch an app with the [;max launchbrowser] message.

It seems in case of apps, this message doesn’t want the full path as for example :

[;max launchbrowser HD:/Users/folder/folder/file]

but
[;max launchbrowser file:///Users/folder/folder/file]

So I must remove the first part of my path (the "HD:/") and replace it by (file:///) .

Here’s the deal. I tryed many things with sprintf and others, but without success.

Could anyone give some help.
Thanx.


January 31, 2008 | 3:00 pm

On 31 janv. 08, at 15:08, Derrick Giscloux wrote:

> It seems in case of apps, this message doesn’t want the full path as
> for example :
>
> [;max launchbrowser HD:/Users/folder/folder/file]
>
> but
> [;max launchbrowser file:///Users/folder/folder/file]
>
> So I must remove the first part of my path (the "HD:/") and replace
> it by (file:///) .

This may gives you some ideas:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 78 186 194 196617 file:/Users/folder/folder/file;
#P newex 78 151 62 196617 prepend set;
#P newex 177 56 48 196617 loadbang;
#P message 175 80 77 196617 substitute file:;
#P message 78 32 145 196617 HD:/Users/folder/folder/file;
#P newex 78 114 73 196617 regexp ^.+\\:;
#P connect 4 0 5 0;
#P connect 0 0 4 0;
#P connect 3 0 2 0;
#P connect 1 0 0 0;
#P connect 2 0 0 0;
#P window clipboard copycount 6;

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://www.crfmw.be/max


January 31, 2008 | 6:05 pm

Hi,

Example:

;
max launchbrowser "file:///Applications/Safari.app"

Bye,
PG


January 31, 2008 | 9:56 pm

OUI ! [regexp] , thank you so much Patrick !


Viewing 4 posts - 1 through 4 (of 4 total)