
Anyway I've just downloaded the trial version of MS and the compiler as I'm trying to write a macro for the charity I work for (hence the username) that will automate a very tedious process we have to do on a daily basis.
Basically we record talking books for blind and visually impaired people which means using a format/standard called DAISY. Part of this process creates an XML file which is read by a proprietary program which displays the content of that book as a series of links. Where MS comes in is that once we have the content of the book on screen in terms of the structure i.e. chapters, parts etc, we then have to add in all the pages. This just involves a series of key presses per page but as books can have 100, 200, 300, 1000 pages in them this means a LOT of key presses.
So this is the Macro I've written:
Code: Select all
Input>NumTimes, Enter Numer of Runs:,10
Let>x=0
Repeat>x
SetFocus>EasePublisher
Press CTRL
Press Page Down
WaitWindowChanged>3
Press CTRL
Send>1
Release CTRL
WaitWindowChanged>3
Press Enter
Wait>0.3
Press CTRL
Press Page Down
WaitWindowChanged>3
Release CTRL
Let>x=x+1
Until>x=NumTimes
Line 4 sets the focus to the Program that turns the books into the DAISY format. I had to put this in for the EXE as without it, it would effectively try to run on the Windows desktop.
Lines 5 & 6 is the command to move to the next part of the book where you want to add a page. I had to add this in to the EXE because without it, it didn't seem to know where it was within the list of links.
Line 7 just waits for the screen to refresh as when you move to a new section of the book a waveform display of the audio is displayed and that takes a second or so to do.
Lines 8 - 10 open the window where we enter the page number which automatically increments by itself anyway
Line 11 waits for that window to open
Line 12 hits the enter button which adds the page to the link
Line 13 makes the macro wait. For some reason without this both in the exe or in MS the whole thing just stops. I think it's because the program we use takes a fraction of a second to update itself before you can do anything else. I tried using a WaitWindowChanged command instead but it just sat there and then ran very slowly.
Lines 14 & 15 move to the next link in the XML where the process starts all over again.
Now if I run this within MS it works perfectly no problem at all. However when it's compiled as an .EXE file it seems to jump around and misses every other section of the book. So in other words instead of adding a page under each section it adds a page under every other section which obviously isn't right anyway but also means that the page numbering goes completely out.
Is this normal with the compiler?
Does the trial version of the compiler makes things slower compared to the retail version?
Is there something in my script that could explain these actions?
As we are a registered charity funds are always tight so I want to be sure that I can get this to work as an EXE before we spend the money on the software as this script is the only reason we have for buying it in the first place.