text object question

Dec 2, 2008 at 8:30pm

text object question

is it possible to use a specific search path in a read / write message to a text file?

like: “read ……/Desktop/Files/file.txt”

#41152
Dec 2, 2008 at 8:40pm

Send “read” or “write” followed my an absolute path, enclosed in “quotes” if it contains spaces, to the [text] object. For example:

read “Macintosh HD:/Users/myname/Desktop/filename.rtf”
write “Macintosh HD:/Users/myname/Finances/lotsamonies.csv”

lh

#146307
Dec 2, 2008 at 9:16pm

what if I don’t know user name?
let’s say I have a patch in applications… I want to write a text file to be placed on desktop, on every computer that runs my patch…

#146308
Dec 2, 2008 at 9:49pm

You could try banging [thispatcher] or using javascript to get the location of your patch and then [regexp] the path to find the username and then format the path to the desktop from there. That would work on a mac, as long as your patch was not loaded from somewhere outside of the user’s space on the hard drive. I’m not sure about using this method on a windows machine.

Actually on a mac you could just use applescript with Bill Orcutt’s [shell] external.

lh

– Pasted Max Patch, click to expand. –
#146309
Dec 2, 2008 at 9:56pm

thank you!

#146310
Dec 2, 2008 at 11:03pm

hi,

[getpath] for Mac OS X) or [getenv] for Windows
will give you the user paths (and many others).

both externals can be found in my collection here: http://www.jasch.ch/dl/

hth

/*j

#146311

You must be logged in to reply to this topic.