StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Theinvoker  
#1 Posted : Friday, March 27, 2020 9:18:49 AM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
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.
Theinvoker  
#2 Posted : Friday, March 27, 2020 9:53:14 AM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
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.
Rob  
#3 Posted : Friday, March 27, 2020 10:05:05 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 684
United States
Location: Tampa, FL

Thanks: 13 times
Was thanked: 155 time(s) in 134 post(s)
I think I know why you want this BigGrin

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();
Rob  
#4 Posted : Friday, March 27, 2020 10:06:55 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 684
United States
Location: Tampa, FL

Thanks: 13 times
Was thanked: 155 time(s) in 134 post(s)
Looks like we crossed paths, glad you got it figured out!
thanks 1 user thanked Rob for this useful post.
Theinvoker on 3/27/2020(UTC)
Theinvoker  
#5 Posted : Friday, March 27, 2020 10:57:33 AM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
Location: Milano

Thanks: 2 times
Originally Posted by: Rob Go to Quoted Post
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.
Rob  
#6 Posted : Friday, March 27, 2020 11:02:54 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 684
United States
Location: Tampa, FL

Thanks: 13 times
Was thanked: 155 time(s) in 134 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 !
Theinvoker  
#7 Posted : Friday, March 27, 2020 11:15:51 AM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
Location: Milano

Thanks: 2 times
Originally Posted by: Rob Go to Quoted Post
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?
Rob  
#8 Posted : Friday, March 27, 2020 12:28:39 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 684
United States
Location: Tampa, FL

Thanks: 13 times
Was thanked: 155 time(s) in 134 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 12:31:29 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Rob for this useful post.
Theinvoker on 3/27/2020(UTC)
Theinvoker  
#9 Posted : Friday, March 27, 2020 12:45:07 PM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
Location: Milano

Thanks: 2 times
Nice nice
it works
Theinvoker  
#10 Posted : Thursday, August 20, 2020 6:13:42 AM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
Location: Milano

Thanks: 2 times
Originally Posted by: Rob Go to Quoted Post
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
Rob  
#11 Posted : Thursday, August 20, 2020 7:27:35 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 684
United States
Location: Tampa, FL

Thanks: 13 times
Was thanked: 155 time(s) in 134 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)?
Theinvoker  
#12 Posted : Thursday, August 20, 2020 8:14:30 AM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
Location: Milano

Thanks: 2 times
Originally Posted by: Rob Go to Quoted Post
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 8:15:56 AM(UTC)  | Reason: Not specified

Users browsing this topic
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.