Rank: Advanced Member
Groups: Approved
Joined: 3/24/2020(UTC) Posts: 37 Location: Milano Thanks: 2 times
|
Is it possibile to make a script (and i need help because i don't know how to do it eventually) that does more than 1 action?
I need something that brings in front a minimized software (always the same one) and minimize the one under the cursor.
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 3/24/2020(UTC) Posts: 37 Location: Milano Thanks: 2 times
|
i think i did it. it was easier than expected
Run or activate--Direct Input---sofwtare name and then second action Minimize Window---Event Object---Window
The strange thing is that i had to manually write the software name by myself. browsing i couldn't find any file, just folders.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
I think I know why you want this Here's one example which is pretty simple, so try it first. Change "Firefox" to something in the title of the other program which is unique, so it will always and only match on that app. Code:var workProgram = sp.WindowsFromTitlePartial("Firefox");
if(workProgram.Length > 0)
{
workProgram[0].Activate();
}
action.Window.Minimize();
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
Looks like we crossed paths, glad you got it figured out!
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 3/24/2020(UTC) Posts: 37 Location: Milano Thanks: 2 times
|
Originally Posted by: Rob Looks like we crossed paths, glad you got it figured out! Yes, just because there were the presets commands. if i had to write the script myslef i wouldn't know where to start from. Honestly i doubt you know why i want it was to be able to open a software that i use as video library for a video player that has no library. Now with a gestures i can recall that sofware very easily and quickly. with the video player minizing and not covering the library.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
I gotcha, looked like a gesture to bring a work application to the foreground :)
I was just being funny, or trying to anyway !
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 3/24/2020(UTC) Posts: 37 Location: Milano Thanks: 2 times
|
Originally Posted by: Rob I gotcha, looked like a gesture to bring a work application to the foreground :)
I was just being funny, or trying to anyway ! to bring back... it would be nice to have a command that brings back the last minimized window and not a specific software. is it possible?
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
Sure, you just have to store the last minimized window handle so you can recall it later. Note that this only tracks the last minimized window which was minimized from the Minimize Action Steps - not if you clicked the minimize button on the window, if that makes sense. Code:// Minimize Action Steps
------------------------------------------
Get Object Property By Name
- sourceObject > Event Object > Window
- propertyName > Direct Input > HWnd
Store Handle
- name > Direct Input > LastMinimizedWindow
- value > From Stack
Minimize Window
- window > Event Object > Window
Code://Recall Last Minimized Window Steps
------------------------------------------
Get Stored Handle
- name > Direct Input > LastMinimizedWindow
Get Window From Handle
- handle > From Stack
Set Foreground Window
- window > From Stack
Edited by user Friday, March 27, 2020 6:31:29 PM(UTC)
| Reason: Not specified
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 3/24/2020(UTC) Posts: 37 Location: Milano Thanks: 2 times
|
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 3/24/2020(UTC) Posts: 37 Location: Milano Thanks: 2 times
|
Originally Posted by: Rob Sure, you just have to store the last minimized window handle so you can recall it later. Note that this only tracks the last minimized window which was minimized from the Minimize Action Steps - not if you clicked the minimize button on the window, if that makes sense. Code:// Minimize Action Steps
------------------------------------------
Get Object Property By Name
- sourceObject > Event Object > Window
- propertyName > Direct Input > HWnd
Store Handle
- name > Direct Input > LastMinimizedWindow
- value > From Stack
Minimize Window
- window > Event Object > Window
Code://Recall Last Minimized Window Steps
------------------------------------------
Get Stored Handle
- name > Direct Input > LastMinimizedWindow
Get Window From Handle
- handle > From Stack
Set Foreground Window
- window > From Stack
Hello i don't know why i noticed this thing only now. But this command is not working anymore on KMplayer. I know KMplayer is strange (you explained it in a different topic) but minimizing and recalling was working Minimizing still works but if i use the command to restore the player, it works just 1 time. After restore is done, i can't minimize it anymore, but any other gesture (like closing the player) works
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
It's possible they updated the application and changed some things in terms of the window hierarchy - some apps are really just odd in how they structure themselves and they can change things at any time.
What happens if you change the last step from Set Foreground Window to Restore Window (window > From Stack)?
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 3/24/2020(UTC) Posts: 37 Location: Milano Thanks: 2 times
|
Originally Posted by: Rob It's possible they updated the application and changed some things in terms of the window hierarchy - some apps are really just odd in how they structure themselves and they can change things at any time.
What happens if you change the last step from Set Foreground Window to Restore Window (window > From Stack)? no because i still use a very old version. The new KMplayer (from 3.5 to now) doesn't have video library. I use old versione because i need it no change i don't know if it's important, but i have to run KMplayer as admin Edited by user Thursday, August 20, 2020 2:15:56 PM(UTC)
| Reason: Not specified
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close