Chapter: Renoise Application Api Reference

i’ve tried lots of functions by feeding them to the lua terminal in renoise (copy-paste from document to terminal prompt)

interesting chapter…

i observed that when using a function such as  

the path can’t be something like “c:\windows” because it must use forward slashes:"C:/Windows")  

hmmm… i wonder how i could access a path that in Windows 7 seems to be using blank spaces in the folder name, for example C:\Program (x86)

i’ll investigate that further…

my guess is, since you are quoting the path already, spaces can just be used. if not, i’d try with %20. if that does not work i’d try underscores. it that fails, i’m out of ideas :)

thanks, i tried your ideas as well

didn’t work unfortunately

maybe this is some windows 7 specific issue

i launched the command dos prompt (start logo button, then ‘cmd’ in the search field) and then checked the dir command options

dir /?  

and then i selected the dir /x command to see what the folders look like in short format

on my system that “Program Files (x86)” folder becomes “PROGRA~2” so i used that instead:"C:/Progra~2")  

and that works

seems a bit complicated, but i guess i’ll discover better ways further up the road :)

found something…"C://Program Files (x86)")  

it seems to work if i use double forward slashes and the long name that the dos shell reports (using the dir command)

what i find confusing is that within Windows 7’s own file explorer, that “Program Files (x86)” folder is simply named “Program (x86)”

very strange…

i think it should also work using Environment Variables. what? read some here:
there you see the Environment Variable %ProgramFiles% exists… so maybe try that out?

Was about to say the same rhowaldt (almost used a P again there for some reason :-/ ) but always forget the name Environment Variables so glad you got in before me.

Is needed if you want to get it to work between different version of Windows as things like %AppData% are different between WinXP and Win7 and this is a likely one for you to use. (Is there really not one for My Documents?)

“” is a special character. If you want to use it for paths, double backslash it:“C:\Windows”)

@kazakore: my documents should be this: %HOMEPATH% --> \Documents and Settings{username} [XP] --> \Users{username} [VISTA/7]

@taktik: yes, of course you are right, should’ve thought of that myself :). thanks.

quite useful information about environment variables, didn’t know about those before

although they don’t seem to work at the renoise lua terminal prompt, i tested this at the dos shell prompt, for example

cd %ProgramFiles%  

and it works

Environment variables should be shared within the programming environment to be able to access these.
Renoise by default uses the path of the tool if it remains blank and then there are some other path aliasses available but i should look that up to be sure.

Nope. That takes me to “C:\Documents and Settings\username” Probably usable in most cases though.

My Documents is at “D:\My Documents” as I always move it off the C drive into my Data drive when I install Windows.

@kazakore: well, if you are going to MOVE your My Documents, there is nobody who can help you anymore.
but seriously, if i move my Program Files, surely my %ProgramFiles% Environment Variable would be pointing to the wrong directory as well. a matter of doing:

(yeah, syntax all wrong and Win/Linux combo but you get the gist)

No because that is exactly what Environmental Variables are for! I check the Windows generated My Documents link is any program, or on the Desktop etc etc and it takes me to the location I’ve moved it to because Windows knows I moved it there. Same if you have it based on a Server, which you quite likely will do on a work Domain, where you need to be able to access your files from any computer within the company!

EG If I go %APPDATA% at work I get taken to:

“\Server\FolderRedirections$[i]Username[/i]\Application Data”

hmmm. ok. i’m going to assume you know this better than i do and retreat and write more newbie documentation :)

ok, something else i ran into which i don’t really understand.  

i thought stuff that was preceded by a dot (.) was a property. but it was surprising to see .app() because the ‘()’ indicates the ability to receive arguments, and shows you this is a function. also, in the Renoise App Api Reference, is listed under ‘functions’… so, can a function start with a dot as well? i thought functions were indicated with the colon, : ? this is the case with the next part, app():show_status() … again the () but also the : …

could someone enlighten me a bit, or is this just general LUA inconsistency?

Obviously you have to tell Windows you’re moving it, not just drag and drop into another position (or do so at installation.) They are all part of the Environment of the Operating System, which may have a Variable location. The name itself even suggests that (and it’s thanks to you I’ve come across that as I was trying to find more info on them a couple of months back as it happens.)

That is the unfortunate thing with an OOP oriented language it is not LUA specific, the dot is also used in objects and classes and the definition between objects and classes sometimes seem like a very thin line.

Lua is a very clever language. Whenever someone uses the word clever in programming, it means “advanced”

The colon is just a shortcut. These two functions are identical

t = {};  
function t:foo(bar) end  
function, bar) end  

When you call a function using the colon syntax, you implicitly supply the table left of the colon as the first argument to the function. The following two function calls are identical:

t:foo("baz");, "baz");  

Try it yourself:"Hello"), "Hello")  


@Conner_BW: !!! (understood! thanks!)