 |
|
|
11-19-2019, 09:40 AM
|
#801
|
Human being with feelings
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,684
|
Yes, the functions seem to be limited to windows opened by Reaper/WDL/Swell-applications.
Had the same problem when trying to make autoscreenrecording using LiceCap. I can access LiceCap itself to hit the recordbutton, but not the buttons of the save-file-dialog, which seems to be an os-based-dialog.
Though you can find the windows and their hwnd without a problem...
Last edited by mespotine; 11-19-2019 at 09:49 AM.
|
|
|
11-19-2019, 11:37 AM
|
#802
|
Human being with feelings
Join Date: Jul 2009
Posts: 2,832
|
Quote:
Originally Posted by Edgemeal
Is JS_Window_Destroy() limited to REAPER child windows only or something? Was trying to close a Windows notepad in Win10(1909)...
|
Yes, it is limited to REAPER windows. According to the MS documentation:
Quote:
A thread cannot use DestroyWindow to destroy a window created by a different thread.
|
|
|
|
11-19-2019, 11:44 AM
|
#803
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,494
|
Quote:
Originally Posted by juliansader
|
Thanks!
|
|
|
11-19-2019, 11:47 AM
|
#804
|
Human being with feelings
Join Date: Oct 2017
Posts: 3,020
|
I have some issues with setting the z-order of a non-Reaper window.
I noticed: when changing the Z-order of a window and ALT-Tabbing right afterwards, there are some issues. As if the other windows wouldn't know which z-order they now have.
That means, the title bar is activated, but when using helper programs like Logitech's keyboard software, Stream Deck or iCue from Corsair (they change the shortcuts based on the active window name), these applications show the shortcuts from a different application but not the one where the title bar is activated.
Is it necessary to update all windows, after having changed the z-order?
|
|
|
11-21-2019, 10:58 AM
|
#805
|
Human being with feelings
Join Date: Oct 2014
Posts: 47
|
Help using JS_ReascriptAPI
Hi there.
I would like to use some of the functions like JS_Dialog_BrowseForFolder with Python.
I installed the package from Reapack and restarted Reaper. The functions are listed in the Reascript documentation generated by my current Reaper setup.
As far as I understand I only have to call it as it is, without the usual RPR_ prefix.
So I would simply call:
Code:
( retval, caption, initialFolder, folderOutNeedBig, folderOutNeedBig_sz ) = JS_Dialog_BrowseForFolder("hop", "./C", "", "" )
This gives the following error:
---
Script execution error
Traceback (most recent call last):
File "testFolderSelect.py", line 4, in <module>
( retval, caption, initialFolder, folderOutNeedBig, folderOutNeedBig_sz ) = JS_Dialog_BrowseForFolder("hop", "./C", "", "" )
NameError: name 'JS_Dialog_BrowseForFolder' is not defined
---
What am I missing?
C
|
|
|
11-21-2019, 11:03 AM
|
#806
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,990
|
Quote:
Originally Posted by Cedrik0s
As far as I understand I only have to call it as it is, without the usual RPR_ prefix.
|
Try with the RPR_ prefix. (It could be possible that the JS extension has not been tested to work with Python, though.)
|
|
|
11-21-2019, 11:05 AM
|
#807
|
Human being with feelings
Join Date: Oct 2014
Posts: 47
|
Quote:
Originally Posted by Xenakios
Try with the RPR_ prefix.
|
Thanks for your answer Xenakios.
I did with RPR_JS_, RPR_, JS_ ...
Always the same error.
|
|
|
11-21-2019, 11:23 AM
|
#808
|
Human being with feelings
Join Date: Jul 2009
Posts: 2,832
|
Quote:
Originally Posted by Xenakios
Try with the RPR_ prefix. (It could be possible that the JS extension has not been tested to work with Python, though.)
|
I haven't yet used Python with REAPER, and unfortunately have no idea whether the extension is compatible with Python.
|
|
|
11-21-2019, 12:24 PM
|
#809
|
Human being with feelings
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,684
|
Afaik, there's a file for that, which needs to be added and includes all functions-declarations.
There's already one included with SWS and Reaper:
reaper_python.py
sws_python.py
sws_python64.py
so I think, one like that would be needed for JS-extension too.
Somewhere in this thread, someone made such a file, but it's for an older version and I don't remember, which post it had...
|
|
|
11-21-2019, 12:51 PM
|
#810
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,183
|
Quote:
Originally Posted by mespotine
Afaik, there's a file for that, which needs to be added and includes all functions-declarations.
There's already one included with SWS and Reaper:
reaper_python.py
sws_python.py
sws_python64.py
so I think, one like that would be needed for JS-extension too.
Somewhere in this thread, someone made such a file, but it's for an older version and I don't remember, which post it had...
|
This one is the latest I think (at least I haven't spotted any newer ones here):
https://stash.reaper.fm/v/36404/js_ReaScriptAPI.py
@juliansader
If you consider providing the Python function wrappers in the future, as mentioned in the related post they are quite straightforward to generate using the Perl scripts SWS is also using to generate them.
edit:
@Cedrik0s
Where to put that file and a simple Python test script can also be found in above post.
Last edited by nofish; 11-21-2019 at 03:00 PM.
|
|
|
11-21-2019, 05:17 PM
|
#811
|
Human being with feelings
Join Date: Oct 2014
Posts: 47
|
Since the JS functions are listed in the generated documentation, I took it for granted it was supported for python.
Anyway it is great news to see it somehow is, and I will check the other thread as soon as I can.
Thank you all!
PS : if there is any other way to get basic select file/folder dialog from a python reascript, I'd be glad to know!
|
|
|
11-21-2019, 05:25 PM
|
#812
|
Human being with feelings
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,684
|
For file, you can use:
https://mespotin.uber.space/Ultrasch...ileNameForRead
It only allows selecting one file and you cannot use it for selecting non-existant files(which is essential for file-save).
For folder, nothing of that exists.
But, if you only need that for your own scripts, you could use GetUserFileNameForRead, select a file and extract the path from the selected file. Would be a hack, though, but could work, unless the folder is empty.
|
|
|
11-24-2019, 04:23 AM
|
#813
|
Human being with feelings
Join Date: Oct 2014
Posts: 47
|
Thanks mespotine.
GetUserFileNameForRead could be a solution for single file selection indeed.
Btw, your documentation with comments (i.e. documention  ) is nice!
I have yet to try the js_ReaScriptAPI.py.
Will do.
Thanks all.
C
|
|
|
12-05-2019, 04:21 AM
|
#814
|
Human being with feelings
Join Date: Apr 2014
Posts: 3,202
|
Hi Julian,
I'm trying to overlay part of a JSFX GUI over one of my script GUIs. I've currently tried a lot of things and none are perfect.
Most success has been had by creating a an 'overlay' window and GDI blitting between the JSFX window and the new overlay window and keeping that on top of my script gui using TOPMOST. But this isn't ideal as it sits over other windows that I don't want it to sit over - I simply want it to sit above just my script GUI window and no others. I've tried writing code to release the TOPMOST flag of the created window when other windows have the focus - but it's clunky and doesn't work perfectly - depending on what window has focus - the overlay window sometimes falls behind the script GUI - especially when it's docked.
I've tried the Composite LICE bitmap method - but being on WindowsOS - this is headache inducing with the amount of flicker.
So I've had another idea and I don't know if it is feasible - but you might. Is it possible to set the overlay window as a child of my script GUI window using something like SetParent Windows API? I don't know whether this would work as it may depend on the window process ownership of the window. Any thoughts? Obviously the SetParent API isn't available in your API - and I wondered if there was any reason? If the overlay window was able to be made a child window - could it somehow be hooked into keeping it's relative location with the parent script GUI window?
Can you think of any other way of keeping the overlay window just above my script GUI without using TOPMOST which might work more consistently?
Cheers,
L.
Overlay window :
I also created a LICE gif of the flickery Composite method - but interestingly the GIF doesn't show the flicker (possibly framerate or LICE related).
|
|
|
Yesterday, 03:35 PM
|
#815
|
Human being with feelings
Join Date: Feb 2017
Posts: 41
|
JS api calls into other C++ extensions?
@Julian
Julian, your API is awesome!!! I use it everyday. I was wondering, do you have any thoughts on letting us add your API to other c++ extensions? I have a reaper extension right now that I'm trying to figure out how to take away the reaconsole window. I know ultraschall does it, but it would be in lua and not through c++. I see he is using your JS window functions to get this to work, but I can't call your functions in c++ without somehow adding your library somewhere. Are you thinking of exposing an API list directly from c++ sometime?
Thanks for all the magic work!
|
|
|
Yesterday, 03:41 PM
|
#816
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 2,886
|
You can just use the Win32 API directly in C++. (You can use extension-provided API functions too, as long as you import them after they were registered.)
Last edited by cfillion; Yesterday at 04:23 PM.
|
|
|
Yesterday, 03:56 PM
|
#817
|
Human being with feelings
Join Date: Feb 2017
Posts: 41
|
@Julian
Nevermind! I found Julian's github repository!
Yeah, I just wanted to see how Julian was going about getting the window information as a starting point!
|
|
|
Today, 12:14 PM
|
#818
|
Human being with feelings
Join Date: Jul 2009
Posts: 2,832
|
Quote:
Originally Posted by lb0
So I've had another idea and I don't know if it is feasible - but you might. Is it possible to set the overlay window as a child of my script GUI window using something like SetParent Windows API? I don't know whether this would work as it may depend on the window process ownership of the window. Any thoughts? Obviously the SetParent API isn't available in your API - and I wondered if there was any reason? If the overlay window was able to be made a child window - could it somehow be hooked into keeping it's relative location with the parent script GUI window?
Can you think of any other way of keeping the overlay window just above my script GUI without using TOPMOST which might work more consistently
|
Unfortunately I don't know if the SetParent approach will work, but it is worth a try! I will add SetParent to the next update of the extension.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:14 PM.
|