<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1700" Guid="{0F608EC4-DE20-4675-999F-5BE82D6DCB23}" Time="1452381256.09">
    <Autostart Name="Autostart" Expanded="True">
        <Plugin Identifier="DirectoryWatcher" Guid="{003FABA6-AA6A-4395-9DB6-DC88EB07F5FE}" File="DirectoryWatcher">
            gAJYDQAAAEM6XDIwMTYgRGlhcnlxAImGcQEu
        </Plugin>
        <Plugin Identifier="FileOperations" Guid="{50D933C5-F93B-4A8A-A6CE-95A40F906036}" File="FileOperations">
            gAIpLg==
        </Plugin>
        <Plugin Identifier="Timer" Guid="{6149CA99-1FCD-4450-9160-7543BC20CFD3}" File="Timer">
            gAIpLg==
        </Plugin>
        <Plugin Identifier="Speech" Guid="{76A1638D-1D7D-4582-A726-A17B1A6FC723}" File="Speech">
            gAIpLg==
        </Plugin>
    </Autostart>
    <Folder Name="Config tree root" Expanded="True">
        <Folder Name="Diary" Expanded="True">
            <Macro Name="Python script Diary" Expanded="True">
                <Event Name="Main.OnInit" />
                <Action>
                    EventGhost.PythonScript(u'diary_root = "C:"\ncode_page = eg.systemEncoding\n\nfrom datetime import date as dt\nfrom calendar import setfirstweekday, monthcalendar\nfrom os.path import isfile\nimport codecs\n\nWEEK = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")\nYEAR = (\n    "January",\n    "February",\n    "March",\n    "April",\n    "May",\n    "June",\n    "July",\n    "August",\n    "September",\n    "October",\n    "November",\n    "December"\n)\ntoday = dt.today()\nday  = today.day\nwd = today.isoweekday() - 1\nsetfirstweekday(0)\nmonth = monthcalendar(today.year, today.month)\nweek = 1 + [w[wd] for w in month].index(day)\ntoday_file = r"%s\\%i Diary\\%s\\Week %i\\%s.txt" % (diary_root, today.year, YEAR[today.month-1], week, WEEK[wd])\n\nif not isfile(today_file):\n    eg.Exit()\neg.PrintNotice("File valid for today: " + today_file)\n\ninput = codecs.open(today_file, \'r\', code_page, \'ignore\')\ndata = input.readlines()\ninput.close()\nfor line in data:\n    #Here data parsing (time detection)\n    eg.TriggerEvent("Speak", prefix = "Diary", payload = line)')
                </Action>
            </Macro>
            <Macro Name="Speech: Speak: {eg.event.payload}" Expanded="True">
                <Event Name="System.ClipboardChanged" />
                <Action>
                    Speech.TextToSpeech(u'IVONA 2 Amy - British English female voice [22kHz]', 0, u'{eg.event.payload}', 0, 100)
                </Action>
                <Action>
                    FileOperations.Read(0, u'C:\\temp\\Test.txt', 1, 0, 'cp1252', 1, False, 1)
                </Action>
                <Action>
                    Speech.TextToSpeech(u'IVONA 2 Amy - British English female voice [22kHz]', 0, u'{eg.event}', 0, 100)
                </Action>
            </Macro>
        </Folder>
    </Folder>
</EventGhost>
