remove part of a path : syntaxe problem

Jan 31, 2008 at 2:08pm

remove part of a path : syntaxe problem

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.

#35593
Jan 31, 2008 at 3:00pm

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

#121467
Jan 31, 2008 at 6:05pm

Hi,

Example:

;
max launchbrowser “file:///Applications/Safari.app”

Bye,
PG

#121468
Jan 31, 2008 at 9:56pm

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

#121469

You must be logged in to reply to this topic.