I try to learn Lua and writing plugin for dorico.
i think plugin are very important, because every user can participate in the improvement of the features of Dorico
1st remark, console write two CR for each print …
A single CR would return messages written on console, more readable.
there is no way to delete console ?
I know that is anormaly use of script, but the access to DoApp userdata are open
With lua debug tools, i dump all accessible method and property of DoApp userdata.
here you can see the result : http://www.tomboul.com/dorico/currentScore.htm
The result depend on the open project in Dorico
here my lua programm for dumping all methods and propertys of “userdata” returned by DoApp.doApp() and putting the result into a html file.
http://www.tomboul.com/dorico/debug.lua
I try to do the same for knowing all the availables commands and parameters in doCommand function.
But i dont know how to do …
while doing this dump, i see some errors messages :
when you use ‘name’ property of instruments table
local app=DoApp.DoApp()
print("intrument id (layout 1, players 1, instrument 1) : "..app.currentScore.layouts[1].players[1].instruments[1].id )
print("intrument name (layout 1, players 1, instrument 1) : "..app.currentScore.layouts[1].players[1].instruments[1].name )
-- OUPUT :
-- intrument id (layout 1, players 1, instrument 1) : 10
-- std::exception: 'Not implemented - this may leave the score in an unpredictable state @ ..\..\steam\source\script\scorewrapper.cpp:659'
another one with events, property of item of blockInstances:
local app=DoApp.DoApp()
print("event app.currentScore.flows[1].allStreams[1].blockInstances[1].block "..app.currentScore.flows[1].allStreams[1].blockInstances[1].block.events)
-- OUPUT :
-- std::exception: 'Not implemented - this may leave the score in an unpredictable state @ ..\..\steam\source\script\streamwrapper.cpp:135'
and also numerator or denominator, property of position of item of blockInstance :
local app=DoApp.DoApp()
print("numerator app.currentScore.flows[1].allStreams[1].blockInstances[1].position.numerator "..app.currentScore.flows[1].allStreams[1].blockInstances[1].position.numerator)
-- OUPUT :
-- No matching overload found, candidates:
-- int <unknown>(MIDIPitch const&)
the same error with tonalityDivisions