Link to home
Start Free TrialLog in
Avatar of beatified
beatifiedFlag for United States of America

asked on

AutoHotKey vs Pulover's Macro Creator syntax

So I have been using Pulover's Macro Creator to create a script but cannot create a new variable like this.

AptNum%A_Index% := Clipboard

Obviously I can type the code but I cannot create this in Pulover's Macro Creator.

See the screen shot.
Image-5.jpg
SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of beatified

ASKER

Well the reason I'm not making my own scripts from scratch is that I have a much harder time with AHK. It just requires a lot of prior knowledge or at least constant referring back to the documentation to make get at the stuff I want to accomplish.

I actually started with AHK but found Pulover's Macro Creator and really like the simplicity it offers. I know its probably better for me to be creating my own scripts from scratch but I'm just in kind of a time crunch.

Maybe what I'll do is use Pulover's Macro Creator as much as I can then export to AHK and fix the stuff that should be working but isn't. Honestly there probably isn't a whole lot that is broken. So I dont think that should be too hard.

Thanks for the help again Joe.

Stuart
> Maybe what I'll do is use Pulover's Macro Creator as much as I can then export to AHK and fix the stuff that should be working but isn't.

Good idea! I know nothing about Pulover's Macro Creator, but if you post the AutoHotkey code, I'll be happy to help. Regards, Joe
Again Thanks so much for your help It is really appreciated. I'll work on it a little and see what happens but I will leave the question open for now but. I will reward you the points for sure even if I don't need any further help.

By the way I am emailing Pulover to inform him of the problem as I'm sure its something he would like to know.
> I will reward you the points for sure even if I don't need any further help.

I'm not worried about the points.

> I am emailing Pulover to inform him of the problem

Another good idea! Let me know what he says — I'm very interested.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok I'm having a problem with the first copy and assign variable.

If you run it you will see what I mean.
Pay special second line of the msgbox. It seems to be applying both what was in the clipboard before the script was run and somehow its applying Cell B:29 clipboard contents

You must open the excel file before you run the script.

BTW I am using Excel 2016 not sure everything will work correctly on a different version.

I tried correcting this but cant figure it out.
DOS-Test.ahk
9-1-2016-Deposits.xlsx
BTW if you tell it line 2 and 28 records it should process everything.

It looks like its messing up the first line and last line.

And now that I look at it it seems its missing a date on 1040-C maybe thats a timing issue?
Image-6.jpg
Ok found the issue with 1040-C it was a typo.
Oh and the deposit number is the sheet name. In this case 14698.
Stuart,
I'm going out to dinner now with my family. Will look at this later tonight or tomorrow. But in the meantime, describe for me what you are trying to achieve (not how). It may be a lot easier to write a script from scratch than to fix up what Pulover generates, but to do that, detailed specifications are necessary. Regards, Joe
Yeah of course please go to dinner.

But at this stage all I am trying to do is create variables for each cell except in column H.

The overall goal is automated data entry essentially.

My dad is using an obsolete and ancient database program for DOS and WP5.1 for DOS in order to track payments and amount owed.

Not only is it obsolete but also not normalized at all and the math is being done in WP not in DBASE.

Because it's not normalized and data entry is done in both WP and DBASE and is redundant I am trying to get the data needed into Excel then use that to enter the data automatically into his current system.

This is a short term fix so that it will simply take an hours worth of work and cut it down to a few minutes.

The goal eventually is to migrate to a Access DB.

My Dad has pretty severe pain in his eyes and is seeing horribly at this point so everything is getting much harder than it ever has been for him. He is very reluctant to change the way he does things so I am trying to at least make it easier at this point then move to Access as a longer term goal.

Seriously thank you so much for your knowledge and expertise so many people on here are only willing to do the bare minimum and you have not been that way at all. It is highly appreciated.
Back from dinner.

> If you run it you will see what I mean.

I opened the spreadsheet (in Excel 2016), ran the script, and answered the three prompts with:

14698
2
28

Nothing happened. I saw no mouse movement and the spreadsheet was not changed in any way — I closed it and there was no "Want to save your changes" warning.

> It seems to be applying both what was in the clipboard before the script was run

That means you didn't clear the contents of the clipboard at the start of the script, i.e.:

Clipboard:=""

> It looks like its messing up the first line and last line.

As I said, it doesn't do a thing here.

> But at this stage all I am trying to do is create variables for each cell except in column H.

Is that not working? What variables are not being created?

> The overall goal is automated data entry essentially.

I'd like to understand that better.

Where is the original data?

By "data entry" do you mean from the original data source into the spreadsheet?

How does the spreadsheet get created?

Btw, that code is really hard to read. Regards, Joe
OK so it's not supposed to do anything other than copy the text and save create the variables with the copied text.

Did it create the Msgbox?
> Did it create the Msgbox?

No. Eventually I exit it from the system tray icon.
Okay after it is done it should create a message box.
> Okay after it is done it should create a message box.

How long should it run?
It should do it immediately after it finishes with column I.
The message box is only there to confirm that everything is working correctly
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry about the scare. Is there a better way to do this?

I considered just calling each cell the same way I select the first Cell and not doing the tab and arrow thing. In other words select B:2 B :3 and so on.

So after the variables get created the idea is simple just use send to send the variables to DOS programs.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks so much for the script and all the hlep. The data is manually entered.

So this is the flow at the moment.
1. Check is received
2. Info for the check is handwritten onto a piece of paper.
3. Receipt is hand written.
4. Check info is entered into WP 5.1.
5. Macro is run that does the math and calculates the balance.
6. DBase is opened and there are about 4 steps that are all redundant and not even close to normilized in completely different DB files. All these steps are just entering the same information as what is on the hand written version.

My future version of this.
1. Enter the check info into Excel (only as a means to create a master record of all checks)
2. Hand write the receipt (my dad just insists on this)
3. Have the script store all the info needed as variables and then enter all that info into WP 5.1 and in all needed places in DBase.
4. Done.

So after the initial data entry into Excel which will be the only time consuming part of all this. There will be no other work involved other than running the script. This takes me hours and hours each day to do. And my dad can hardly see and is in pretty bad pain most of the day and he tends to insist on doing this even though I'm capable of doing it. I guess when I started doing it the first time I quickly understood that this could be automated and made much easier.

Also when a mistake is made in DBase it is extremely dificult to fix. And the way that I see it is as long as the data in Excel is accurate and the script runs properly then the chance for error is zero. I would rather take a few minutes and assure myself that the data in Excel is correct in the long run. I stand a much better chance at accuracy that way.

I fully understand this is a bandage to a gaping wound but none the less it will relieve a ton of stress and give me time to make the full blown Access Database.

So this idea is just to make life easier at the moment and honestly its a learning experience for me. Although I understand the concepts involved in databases and scripts putting them into practice is much harder for me. Its more of a syntax issue for me and understanding how to do things efficiently not just do them. Also how to do things in order to minimize the chance for error in the script.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Selected posts provide a solution.