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.
get opened documents
Moderators: Víctor Paredes, Belgarath, slowtiger
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
get opened documents
Last edited by davoodice2 on Thu Sep 30, 2021 3:34 pm, edited 1 time in total.
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
Re: get opened documents
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.
By the way moho:FileOpen(path) always seems to crash here. Not sure if its my system or a bug.
- synthsin75
- Posts: 9981
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: get opened documents
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.
So Lukas' suggestion would be about it, unless you wanted to use something like AutoHotkey (Windows only) to automate cycling through the tabs.
That's odd. I haven't seen that problem. Just tried to verify it, and still works here.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
Re: get opened documents
thank you.
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
Re: get opened documents
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?synthsin75 wrote: ↑Thu Sep 30, 2021 6:30 pmThat's odd. I haven't seen that problem. Just tried to verify it, and still works here.
- synthsin75
- Posts: 9981
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: get opened documents
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.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: get opened documents
Thanks for verifying, I've reported it.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.