Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

remap keyboardkey diffrent for different days.

If you have a question or need help, this is the place to be.
Post Reply
bolets
Posts: 31
Joined: Wed Apr 04, 2007 2:38 pm

remap keyboardkey diffrent for different days.

Post by bolets »

when i press f1 key monday-saturday i want it to insert 12345 insert a key sequence. When i press f1 key on sunday i want it to paste 6789. Can this be done with this fantastic program? How then?

Thanks!
Last edited by bolets on Fri Apr 06, 2007 8:31 pm, edited 1 time in total.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Post by Bartman »

Insert a Python script with the following code in your macro immediately followed by a jump action.

Code: Select all

import time
eg.result = time.localtime()[6] == 6
bolets
Posts: 31
Joined: Wed Apr 04, 2007 2:38 pm

Post by bolets »

bartman. could you please give me some more info on this matter. what more then inserting the python script.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Post by Bartman »

This should to the trick. Just copy and paste the code below.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="939">
    <Folder Name="Test" Expanded="True">
        <Macro Name="Python Skript" Expanded="True">
            <Action>
                EventGhost.PythonScript(u'import time\neg.result = time.localtime()[6] == 6')
            </Action>
            <Action>
                EventGhost.NewJumpIf(XmlIdLink(536), 0, False)
            </Action>
            <Action Name="WeekdayAction">
                EventGhost.Comment()
            </Action>
        </Macro>
        <Macro Name="SundayMacro" id="536" Expanded="True">
            <Action Name="SundayAction">
                EventGhost.Comment()
            </Action>
        </Macro>
    </Folder>
</EventGhost>
bolets
Posts: 31
Joined: Wed Apr 04, 2007 2:38 pm

Post by bolets »

sorry but i really dont get this. I have created a python script with the encloesed code. i have also made a macro called WeekdayAction and a macro called SundayAction. But i cant get it to work. Do i use jump to after the script or what should i do?

Discriptions log:
Traceback (most recent call last):
AttributeError: Compile instance has no attribute 'code'
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Post by Bartman »

The second code I posted should be copied while you are in the configuration tree. It contains all the necessary macros and actions.
bolets
Posts: 31
Joined: Wed Apr 04, 2007 2:38 pm

Post by bolets »

Wonderbart! Thanks a million Bartman for your patience and kindness!
Post Reply