Page 1 of 1
get opened documents
Posted: Thu Sep 30, 2021 2:18 pm
by davoodice2
hi.
I want to change some properties of all open documents
any body can help?
how to get list of open documents?
and access to their project setting.
Re: get opened documents
Posted: Thu Sep 30, 2021 2:22 pm
by Lukas
Not that I know of, but moho:LoadDocument(path) returns a mohodocument. So you could maybe do it that way if you loop through files in a folder.
By the way moho:FileOpen(path) always seems to crash here. Not sure if its my system or a bug.
Re: get opened documents
Posted: Thu Sep 30, 2021 6:30 pm
by synthsin75
Sadly, the API doesn't provide access to other open tabs, or even if they exist. It only reports the current tab as moho.document.
So Lukas' suggestion would be about it, unless you wanted to use something like AutoHotkey (Windows only) to automate cycling through the tabs.
Lukas wrote: ↑Thu Sep 30, 2021 2:22 pm
By the way moho:FileOpen(path) always seems to crash here. Not sure if its my system or a bug.
That's odd. I haven't seen that problem. Just tried to verify it, and still works here.
Re: get opened documents
Posted: Thu Sep 30, 2021 7:01 pm
by davoodice2
thank you.
Re: get opened documents
Posted: Fri Oct 01, 2021 10:19 am
by Lukas
synthsin75 wrote: ↑Thu Sep 30, 2021 6:30 pmLukas wrote: ↑Thu Sep 30, 2021 2:22 pm
By the way moho:FileOpen(path) always seems to crash here. Not sure if its my system or a bug.
That's odd. I haven't seen that problem. Just tried to verify it, and still works here.
Hmmm, I did some tests and it does works here on a basic file (I only tested it on files containing embedded layerscripts apparently). But if I try to open a (relatively simple file) with any layerscript attached at any layer it completely keeps Moho hanging at the "Opening file..." state. And I need to kill the process. The files open fine manually. It even happens on a layerscript that doesn't do anything. Are you able to open a Mohofile with moho:FileOpen(path) that contains an embedded layerscript?
Re: get opened documents
Posted: Fri Oct 01, 2021 6:00 pm
by synthsin75
Yep, I can verify that problem with embedded layerscripts. I initially thought we could get around that by temporarily removing them, using moho:LoadDocument(path), but you can only read a document with that.
Re: get opened documents
Posted: Sat Oct 02, 2021 8:15 am
by Lukas
synthsin75 wrote: ↑Fri Oct 01, 2021 6:00 pm
Yep, I can verify that problem with embedded layerscripts. I initially thought we could get around that by temporarily removing them, using moho:LoadDocument(path), but you can only read a document with that.
Thanks for verifying, I've reported it.