So I tried to come up with a script that will open the browser once the mouse cursor reaches the end of the right edge of the screen and will hide it once the cursor crosses a certain point, when you start moving back left. In order to properly toggle it, I made 2 screenshots of the word "browse" at the bottom right corner and utilize Imagesearch. When "browse" is surrounded by blue colour, browser shows and when it's not, it's hidden. Here's my script:
Code: Select all
f10::
last_pos := 999999
Loop {
MouseGetPos, x, y
if (x > 2560 && last_pos <= 2560)
{
ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, *216 C:\Users\...\Studio One - BrowserOff.png
if ( ErrorLevel = 0 )
{
send ^b
}
else
return
}
if (x < 2080 && last_pos >= 2080)
{
ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, *216 C:\Users\...\Studio One - BrowserOn.png
if ( ErrorLevel = 0 )
{
send ^b
}
else
return
}
last_pos := x
Sleep 10
}
return
1. If for whatever reason the cursor crosses the right edge of the screen twice, before it reaches the "hide browser" point on the x axis on the left, toggling occurs so the conditions the browser appearing and disappearing are reversed! The same goes if the cursor moves to the right, crossing the "hide browser" point but does not reach the edge. The next time it moves back left, crossing the "hide" point, it shows up instead.
2. When I drag and drop an instrument, effect or file, most of the time I am done, so the browser needs to hide. Now, I am not sure how to do that. Maybe making screenshots of the different icons (instrument,effect,file) appearing while starting a drag n drop action and by utilizing Imagesearch somehow to send "control+b" to hide it? Maybe in conjunction with a timer? In any case it's something way beyond my coding skills, especially since it has to play well with the rest of the code, so even if I knew I have to use a timer or imagesearch, that wouldn't help me much.
3. Probably the easiest of the problems to solve, at the top of my script I use F10 to fire it up, I'd like it to work when the program opens up, in any case, without pressing a hotkey.
Here's a demonstration of how everything looks (please open the .gif in fullscreen if necessary), ending with drag n dropping a synthesizer (notice the synth icon + the word "VST" during drag n drop), which could help coming up with a solution for problem #2.
Hope it's not something too complicated to pull off? Any idea or completely different approach for the same effect is more than welcome!