Script lua DoApp userdata

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 … :confused:

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

Scripting just isn’t supported at the moment. We put in the basic support for Lua at a very early stage in the project, but unfortunately it hasn’t kept up with the development of the application. So there are some things that might work, but be aware that you risk making irreversable changes to your score. The interface to the underlying event model is likely to be completely changed in the future. We do intend to come back to scripting in a future version, but it’s not something that we’re looking at currently.

but be aware that you risk making irreversable changes to your score

At this time, i don’t use Dorico for my work, I just learns to use it and test his features, so i only use file score for testing. It doesn’t matter if the scores open on Dorico are damaged.

In his state, it is impossible for me to give up Sibelius to definitely work with Dorico.
I wait, but i don’t know when it will be possible …
I trust the team and particulary Daniel :wink:

As what i said : i think plugin are very important, because every users can participate in the improvement of the features of Dorico, Look at Sibelius, many features of it was making by users.

I wish the best to all the team, and in the meantime, I return in sibelius

We are very aware of how important plugins are for the user community, and that’s why we want to do them right. Unfortunately we didn’t manage to get plugins into the shape that we hoped for the initial version, but we figured that the macro recording functionality and ability to access the command system would be useful enough to some users, so we left this in. You have discovered some other parts of the event model, but the whole interface is incomplete and subject to change.