[Pd] Filenames

Chuckk Hubbard badmuthahubbard at gmail.com
Tue Nov 21 01:41:14 CET 2006


My program saves .ji files, and separately saves .trs and .prs files
with the same name as the chosen .ji file.  Same thing when it loads a
.ji file.
Right now, I have something like the attached file.  It should take
the input "filename.ji" and output "filename".
2 problems:
a) any numbers in the file path are replaced with the text "float",
b) it would be nice for it to know whether ".ji" was already on the
end, because if someone types a name for save-as and doesn't put .ji
on the end, it lops off the last three characters as though they were
".ji".

I thought makefilename might help, but it only works for putting
together, not taking apart.
I'm a little rusty on string manipulation in Pd.  Is there a simple
way to set up something like this?

Thanks.

-Chuckk


-- 
"Far and away the best prize that life has to offer is the chance to
work hard at work worth doing."
-Theodore Roosevelt
-------------- next part --------------
#N canvas 527 60 483 755 12;
#X obj 95 215 openpanel;
#X obj 95 341 repack 1;
#X msg 178 242 symbol;
#X obj 214 353 length;
#X obj 95 439 moses;
#X obj 95 299 t a a;
#X obj 95 412 f;
#X obj 166 412 + 1;
#X obj 95 385 t b s;
#X obj 95 491 symbol;
#X obj 95 465 b;
#X msg 159 385 0;
#X msg 213 534 symbol;
#X obj 214 390 - 3;
#X obj 95 530 repack 1;
#X obj 73 69 inlet;
#X obj 95 589 demultiplex;
#X obj 130 130 route browse save;
#X msg 387 478 0;
#X msg 344 476 1;
#X obj 95 270 symbol2list;
#X obj 95 559 list2symbol;
#X msg 180 25 browse;
#X msg 273 37 save as;
#X obj 47 662 print write;
#X obj 166 654 print read;
#X obj 95 186 t b b b;
#X obj 234 182 t b b b;
#X obj 234 212 savepanel;
#X connect 0 0 20 0;
#X connect 1 0 8 0;
#X connect 2 0 20 1;
#X connect 3 0 13 0;
#X connect 4 0 7 0;
#X connect 4 0 10 0;
#X connect 5 0 1 0;
#X connect 5 1 3 0;
#X connect 6 0 4 0;
#X connect 7 0 6 1;
#X connect 8 0 6 0;
#X connect 8 1 9 1;
#X connect 9 0 14 0;
#X connect 10 0 9 0;
#X connect 11 0 6 1;
#X connect 12 0 21 1;
#X connect 13 0 4 1;
#X connect 13 0 14 1;
#X connect 14 0 21 0;
#X connect 15 0 17 0;
#X connect 16 0 24 0;
#X connect 16 1 25 0;
#X connect 17 0 26 0;
#X connect 17 1 27 0;
#X connect 18 0 16 1;
#X connect 19 0 16 1;
#X connect 20 0 5 0;
#X connect 21 0 16 0;
#X connect 22 0 17 0;
#X connect 23 0 17 0;
#X connect 26 0 0 0;
#X connect 26 1 2 0;
#X connect 26 1 12 0;
#X connect 26 1 11 0;
#X connect 26 2 19 0;
#X connect 27 0 28 0;
#X connect 27 1 2 0;
#X connect 27 1 11 0;
#X connect 27 1 12 0;
#X connect 27 2 18 0;
#X connect 28 0 20 0;


More information about the Pd-list mailing list