coll error reading $ symbol

dan m's icon

Hi,
I am trying to save some scripting in a coll object, so the contents/objects of the patch can be saved and recalled by the user. The script contains the symbol # (eg. #0abstraction). When coll writes the script, all the # symbols are converted to $ symbols in the text file (??!). When coll reads the txt file, the following message appears: "error:coll: :errors in text file in line 23."
Line 23 in this case is the line where the first $ symbol appears. Coll wont read beyond this line.

If I edit the txt file with the text edit program and change the $ symbols to the original # symbols, then coll reads the file correctly, though coll will change again those # to $. Why such a fixation? Why the errors?
Thank you
dan

Cycling '74's icon

prueba con esto

[sprintf "%s"]

best
huts

( )
~ O ~    www.kineticsoundsystem.com
( )        

dan m's icon

gracias huts.
However, not sure this works. If I understand you correctly, I should end up with something like: "#0abstraction". The problem is that this script refers to and generates new instances of an existing abstraction, called #0abstraction. Windows doesnt allow the use of "" in the naming of files, so I cannot name my abstraction "#0abstraction".
This is how I generate the script:

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

Cycling '74's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Cycling '74's icon

but it works

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

best
huts

( )
~ O ~    www.kineticsoundsystem.com
( )        

Stefan Tiedje's icon

The # symbol is special, open any max patch as text, and you'll see that
each line starts with a "#". If a # is within a line, it will be
converted to a $, and the $ will be converted back...

Though it might be a bug of coll, as it happens even when you just edit
the existing coll and resave it (without writing it to disk).

This probably never came up as I can't imagine that this would ever be
usefull. What do you want to achieve with a scripted #0abstraction? If
that symbol is within a subpatcher it will be replaced with a unique
number on loading, if you create it with scripting, it won't be replaced...

There is probably a better way to do what you want without touching that
"bug"

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Peter Castine's icon

Why not regexp the messages going in and out of your coll, replacing
hash marks with something unique but harmless like ampersand or @ or
the string 'hashmark'?

-------------- http://www.bek.no/~pcastine/Litter/ -------------
Peter Castine +--> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

dan m's icon

yep, no need to go into the bug after all... sorry guys! The solution was, as huts suggested, in saving every script line (and not just the word '#0abstraction' as I thought he meant) as a symbol (1,"script new...0#abstraction"; 2, "script new ..." etc). This way coll doesnt change the # into $. Then I can recall the script from coll into thispatcher via fromsymbol.