TaskMonitorPlus plugin - v0.0.5

Questions and comments specific to a particular plugin should go here.

Re: TaskMonitorPlus plugin - v0.0.5

Postby Neytrino-OnLine » Wed Sep 13, 2017 5:11 am

kgschlosser wrote:well you can use the WindowInfo object that is returned as an object to send the keys also. You do not need to use Find Window for this specific task. If you give me a list of the key combinations and what thoes combinations do I can put something together for you pretty quickly.

It is looks like You dislike Find Window so mutch ;)

Ok... That hotkeys i using at the moment:
{Shift+P} - Replay
{Left} - Rewird
{K} or {Space} - Play/Pause
{Right} - Forward
{Shift+N} - Skip
{M} - Mute
{F} - Toggle FullScreen
Sin©erely yours, Neytrino.
User avatar
Neytrino-OnLine
Experienced User
 
Posts: 62
Joined: Tue Aug 20, 2013 7:14 pm
Location: Moscow, Russia

Re: TaskMonitorPlus plugin - v0.0.5

Postby kgschlosser » Wed Sep 13, 2017 5:33 am

Its not that I dislike it. it's extremely powerful and very useful. Provided 2 things. A: you know how to use it, and B: The GUI of the program is not a custom drawn GUI
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TaskMonitorPlus plugin - v0.0.5

Postby kgschlosser » Wed Sep 13, 2017 5:35 am

Neytrino-OnLine wrote:It is looks like You dislike Find Window so mutch ;)

Ok... That hotkeys i using at the moment:
{Shift+P} - Replay
{Left} - Rewird
{K} or {Space} - Play/Pause
{Right} - Forward
{Shift+N} - Skip
{M} - Mute
{F} - Toggle FullScreen


OK one more thing I need the events for the remote button presses
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TaskMonitorPlus plugin - v0.0.5

Postby Neytrino-OnLine » Wed Sep 13, 2017 5:55 am

kgschlosser, different in fact is not buttons... For example I press the Play button, EG get MCE.Play event, than: if pressing was short - one event will be generated if long - another...
Sin©erely yours, Neytrino.
User avatar
Neytrino-OnLine
Experienced User
 
Posts: 62
Joined: Tue Aug 20, 2013 7:14 pm
Location: Moscow, Russia

Re: TaskMonitorPlus plugin - v0.0.5

Postby kgschlosser » Wed Sep 13, 2017 6:05 am

I know there can be 2 different events for a single button. I want to know which events do you want to run the different key combinations. I have already done the whole thing up already and this is the last bit i need.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TaskMonitorPlus plugin - v0.0.5

Postby Neytrino-OnLine » Wed Sep 13, 2017 6:17 am

{Shift+P} - Replay - Main.Tasks|Replay
{Left} - Rewird - Main.Tasks|Rewind
{K} or {Space} - Play/Pause - Main.Tasks|Play & Main.Tasks|Pause (I use two events)
{Right} - Forward - Main.Tasks|Forward
{Shift+N} - Skip - Main.Tasks|Skip
{M} - Mute - Main.Tasks|Mute
{F} - Toggle FullScreen - Main.Windows|FullScreen
Sin©erely yours, Neytrino.
User avatar
Neytrino-OnLine
Experienced User
 
Posts: 62
Joined: Tue Aug 20, 2013 7:14 pm
Location: Moscow, Russia

Re: TaskMonitorPlus plugin - v0.0.5

Postby kgschlosser » Wed Sep 13, 2017 6:24 am

OK You lost me with the Main.Tasks| thing. I have no clue what you mean by it.

So this is what I am going to do. below is the XML code for the macros. There is a Jump in it that you will have to redo. the Jump Settings are
If: last action unsuccessful
Jump to: YouTube Not Playing
Unchecked: and return after execution

In the Checking remote button action (Python Script) you will see the following in the file.
Code: Select all
key_mapping = dict(
    Replay='{Shift+P}',
    Rewind='{Left}',
    Play='{Space}',
    Pause='{Space}',
    Forward='{Right}',
    Skip='{Shift+N}',
    Mute='{M}',
    FullScreen='{F}'
)


This is the event to keystroke mapping. You need to change the mappings to match the suffix of the event that gets triggered for the specific button you want to use.
So if you want to use the Stop button to play the YouTube video then you would change Play='{Space}' to be Stop='{Space}'.

If you want a different/multiple events to be processed by the Remote checking you will have to add the event prefix to the macro. with a .* after it. I highly recommend you do NOT use Main.* as this will parse all events that occur with the prefix of Main. If you need to add multiple events to send the keys then you will have to add a new line to the key mapping for those suffixes with the same keystroke. as you see how i did with Play and Pause

Here is the XML

Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="WIP">
    <Folder Name="YouTube" XML_Guid="{A1C97D94-D721-4EF7-845A-8FEED458AAB9}" Expanded="True">
        <Macro Name="YouTube Remote" XML_Guid="{49AD5019-705F-4989-8D47-BC8939F6C5E7}" Expanded="True">
            <Event Name="MCE.*" XML_Guid="{CE02F36F-B29A-49F7-9F1F-5954C789EF7B}" />
            <Action Name="Checking remote button" XML_Guid="{6AD38DD3-3A9E-4771-A24E-0494C6280782}">
                EventGhost.PythonScript(u"if not hasattr(eg.globals, 'youtube_window'):\n    eg.globals.youtube_window = None\n\nkey_mapping = dict(\n    Replay='{Shift+P}',\n    Rewind='{Left}',\n    Play='{Space}',\n    Pause='{Space}',\n    Forward='{Right}',\n    Skip='{Shift+N}',\n    Mute='{M}',\n    FullScreen='{F}'\n)\n    \nif eg.globals.youtube_window is None:\n    eg.StopMacro()\n\nbutton = eg.eventString.split('.')[-1]\nif button not in key_mapping:\n    eg.StopMacro()\n        \neg.result = key_mapping[button]\n\n")
            </Action>
            <Action Name="Sending remote button to YouTube" XML_Guid="{265698C4-379D-4C0B-89F4-337DC37C600E}">
                EventGhost.PythonCommand(u'eg.globals.youtube_window.SendKeystrokes(eg.result)')
            </Action>
        </Macro>
        <Macro Name="Checking if YouTube is playing" XML_Guid="{A07A7A07-D2C7-4EB9-AF03-B46A39D7474C}" Expanded="True">
            <Event Name="TaskMonitorPlus.Activated.firefox" XML_Guid="{5F8CE813-127D-4BEF-A3EA-59015EF265AD}" />
            <Event Name="TaskMonitorPlus.TitleChanged.firefox" XML_Guid="{5BCAF444-61B3-4B78-8BBE-6DE70876D7C3}" />
            <Event Name="TaskMonitorPlus.NewWindow.firefox" XML_Guid="{0CA73ACD-7DAD-40E8-93CD-C30957946250}" />
            <Action Name="Checking if YouTube is playing" XML_Guid="{F0CC6812-08D1-425B-A1B8-8AEAFBD495C9}">
                EventGhost.PythonScript(u"window = eg.event.payload\n\ntitle = window.title.split('-')\n\nif len(title) &gt;= 2:\n    if title[1].strip().lower() != 'youtube':\n        eg.result = False\n    else:\n        eg.result = True\nelse:\n    eg.result = False")
            </Action>
            <Action XML_Guid="{959AF9D3-BC54-46B9-A1B4-B86A703A6EDE}">
                EventGhost.NewJumpIf(XmlIdLink(9), 1, False)
            </Action>
            <Action Name="YouTube is playing" XML_Guid="{82717FBE-C0F9-44D1-AC2B-76DD42AE8F11}">
                EventGhost.PythonCommand(u'eg.globals.youtube_window = eg.event.payload')
            </Action>
        </Macro>
        <Macro Name="YouTube Not Playing" id="9" XML_Guid="{A9DEB6E8-4F7E-4B9F-A005-CD3379C7368C}" Expanded="True">
            <Event Name="TaskMonitorPlus.ClosedWindow.firefox" XML_Guid="{3D7A4593-EB66-49AB-BCE4-0877B0BB7F22}" />
            <Action Name="YouTube is not playing" XML_Guid="{B6CD5788-431F-42CA-AE19-ABDDC6EED515}">
                EventGhost.PythonCommand(u'eg.globals.youtube_window = None')
            </Action>
        </Macro>
    </Folder>
</EventGhost>
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TaskMonitorPlus plugin - v0.0.5

Postby Neytrino-OnLine » Wed Sep 13, 2017 6:32 am

I wouldn't use "Main". but I generate these events using TriggerEvent and it doesn't ask me - adding "Main".
Sin©erely yours, Neytrino.
User avatar
Neytrino-OnLine
Experienced User
 
Posts: 62
Joined: Tue Aug 20, 2013 7:14 pm
Location: Moscow, Russia

Re: TaskMonitorPlus plugin - v0.0.5

Postby Neytrino-OnLine » Wed Sep 13, 2017 7:28 am

kgschlosser, So again, we returned to a good old way - to stay in a background and every time when the YouTube tab will be opened - switch somethin... We have spent a lot of time to find out what I already know...
So, let me to ask you last time about this:
kgschlosser wrote:use that event to trigger the find window action. using mozilla the name of the tab that is in focus ends up in the window name and you can wildcard that name for the find window. and use the jump if to jump you to another macro if the find window is successful in locating the window to do whatever it is you need it to do.

Could you show me example how it works?
Sin©erely yours, Neytrino.
User avatar
Neytrino-OnLine
Experienced User
 
Posts: 62
Joined: Tue Aug 20, 2013 7:14 pm
Location: Moscow, Russia

Re: TaskMonitorPlus plugin - v0.0.5

Postby kgschlosser » Wed Sep 13, 2017 9:34 am

Neytrino-OnLine wrote:Could you show me example how it works?


I have already explained this to you. but here it goes again.

if you had read the other post I stated about custom drawn GUI's and there being no support for selecting a specific control. and I used Firefox as one of these examples of a program that uses a custom drawn GUI. So with Firefox you do not have the ability to send keystrokes to anything other then the main GUI window. I did not make Firefox and this is because of the way Firefox was written.This problem is not a problem with EG it is a problem with Firefox.


Neytrino-OnLine wrote:kgschlosser, So again, we returned to a good old way - to stay in a background and every time when the YouTube tab will be opened - switch somethin...


I gave you the code to make this work. I do not understand what the problem is now. if you do not like the way it has to be done then I am unable to help you as this is the best/easiest possible solution at the moment.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Previous

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 6 guests