Ingreso rápido:  

Forum: VirtualDJ Technical Support

Tema: os2l and variables
Hello
VirtualDJ has a command os2l_button which sends a button click. Is it possible to somehow send the button name from a variable? for example, I want to send the title of a track to another program.
The scripting language is poorly described and looks strange to me (and I'm a programmer). How can you do something like

os2l_scene $get_filename

I tried different combinations of variables, but the result is the same - os2l_scene just passes what comes after it

Or the color of the track. Each track has its own color depending on the mood and the color transfer changes the lighting in the hall. Now you have to do this:

param_equal `deck 1 get_loaded_song 'color'` "darkgrey" ? os2l_button "darkgrey" :
param_equal `deck 1 get_loaded_song 'color'` "lightgrey" ? os2l_button "lightgrey" :
param_equal `deck 1 get_loaded_song 'color'` "white" ? os2l_button "white" :
param_equal `deck 1 get_loaded_song 'color'` "darkred" ? os2l_button "darkred" :
param_equal `deck 1 get_loaded_song 'color'` "pink" ? os2l_button "pink" :
param_equal `deck 1 get_loaded_song 'color'` "red" ? os2l_button "red" :
param_equal `deck 1 get_loaded_song 'color'` "orange" ? os2l_button "orange" :
param_equal `deck 1 get_loaded_song 'color'` "yellow" ? os2l_button "yellow" :
param_equal `deck 1 get_loaded_song 'color'` "beige" ? os2l_button "beige" :
param_equal `deck 1 get_loaded_song 'color'` "green" ? os2l_button "green" :
param_equal `deck 1 get_loaded_song 'color'` "cyan" ? os2l_button "cyan" :
param_equal `deck 1 get_loaded_song 'color'` "marine" ? os2l_button "marine" :
param_equal `deck 1 get_loaded_song 'color'` "blue" ? os2l_button "blue" :
param_equal `deck 1 get_loaded_song 'color'` "violet" ? os2l_button "violet" :
param_equal `deck 1 get_loaded_song 'color'` "magenta" ? os2l_button "magenta" : nothing

It is very uncomfortable. Is there any normal way to pass a variable?
 

Mensajes Sun 07 Jul 24 @ 7:57 am
locoDogPRO InfinityModeratorMember since 2013
for verbs that don't directly accept an action as a parameter you pass by casting

get_filename & param_cast & os2l_scene
set aString `get_filename` & get_var aString & param_cast & os2l_scene
 

Mensajes Sun 07 Jul 24 @ 8:34 am
AdionPRO InfinityCTOMember since 2006
os2l_button does accept script directly though, so you can also use
os2l_button `deck 1 get_loaded_song 'color'`
 

Mensajes Sun 07 Jul 24 @ 10:23 am
LOCODOG, thanks you very much, it`s work:
set aString `get_filename` & get_var aString & param_cast & os2l_scene

ADION, it`s not work:
os2l_button `deck 1 get_loaded_song 'color'`
i try this:
set aString `deck 1 get_loaded_song 'color'` & get_var aString & param_cast "text" & os2l_scene

but not work too...
 

Mensajes Sun 07 Jul 24 @ 6:51 pm
AdionPRO InfinityCTOMember since 2006
you might need to add & param_cast 'string' to make sure the color is sent as text to os2l_button
 

Mensajes Sun 07 Jul 24 @ 7:01 pm
Not work
I try this code assigned on custom button

set aString `get_loaded_song 'color'` & get_var aString & param_cast 'string' & os2l_button

does virtual dj have any debugging tools? Is it possible to look for errors somewhere and find out what’s wrong?
Not only is the scripting language very strange, it is also poorly documented (
 

Mensajes Mon 08 Jul 24 @ 6:36 am