Old 11-19-2019, 09:40 AM   #801
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

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...
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635

Last edited by mespotine; 11-19-2019 at 09:49 AM.
mespotine is offline   Reply With Quote
Old 11-19-2019, 11:37 AM   #802
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,827
Default

Quote:
Originally Posted by Edgemeal View Post
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.
juliansader is offline   Reply With Quote
Old 11-19-2019, 11:44 AM   #803
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,482
Default

Quote:
Originally Posted by juliansader View Post
Yes, it is limited to REAPER windows. According to the MS documentation:
Thanks!
Edgemeal is offline   Reply With Quote
Old 11-19-2019, 11:47 AM   #804
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,011
Default

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?
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 11-21-2019, 10:58 AM   #805
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 47
Default 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
Cedrik0s is offline   Reply With Quote
Old 11-21-2019, 11:03 AM   #806
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,990
Default

Quote:
Originally Posted by Cedrik0s View Post
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.)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 11-21-2019, 11:05 AM   #807
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 47
Default

Quote:
Originally Posted by Xenakios View Post
Try with the RPR_ prefix.
Thanks for your answer Xenakios.

I did with RPR_JS_, RPR_, JS_ ...
Always the same error.
Cedrik0s is offline   Reply With Quote
Old 11-21-2019, 11:23 AM   #808
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,827
Default

Quote:
Originally Posted by Xenakios View Post
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.
juliansader is offline   Reply With Quote
Old 11-21-2019, 12:24 PM   #809
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

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...
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 11-21-2019, 12:51 PM   #810
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,171
Default

Quote:
Originally Posted by mespotine View Post
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.
nofish is offline   Reply With Quote
Old 11-21-2019, 05:17 PM   #811
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 47
Default

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!
Cedrik0s is offline   Reply With Quote
Old 11-21-2019, 05:25 PM   #812
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

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.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 11-24-2019, 04:23 AM   #813
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 47
Default

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
Cedrik0s is offline   Reply With Quote
Old Yesterday, 04:21 AM   #814
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 3,202
Default

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).
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine | LBX Floating FX Positioner | LBX SRD Smart Knobs
Donate via Paypal
lb0 is offline   Reply With Quote
Old Yesterday, 07:59 AM   #815
QTma7ch
Human being with feelings
 
Join Date: Mar 2012
Posts: 2
Default Automated hardware synth printing?

Hi, First of all, I know pretty much nothing about reascript.

So I was wondering if it could still help me when printing (recording) midi hardware synths.

My workflow consist couple hardware romplers in performance mode and I arrange my song using only midi items sent to my hardware. After I'm done arranging I start to record all midi items one by one. It gets very tedious after I have like 50 midi tracks. This process is repeating same steps over and over, so I thought (and because i don't have an assistant which job this is) maybe reascript can help.

Essentially i want this script to record selected midi tracks one by one to new tracks on time selection

Something like:

-Solo first midi track of the selected ones
-create new track
-set input channel on new track based on midi output device of midi track
-record arm this new track
-set cursors to start of time selection
-press record
-press stop after time selection ends
-disarm track
-unsolo track
-repeat above steps as many times there are as midi tracks


This would save me so many hours of just printing tracks like trained monkey
QTma7ch is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.