Hi all - I have been using KM for a while now. I usually am able to find answers to my challenges via the forums - this community is great for helping others out. However, I have a task I have been trying to solve and just can’t come up with an automation which works. I am mainly struggling with the concept of transferring AppleScript Variables to KM Variables and then Looping certain aspects of the automation. Any help would be appreciated.
- Latest update of Mac;
- Keyboard Maestro Version 8.2
- Gravit Designer (unfortunately I can know longer use Adobe products - so this is a free graphics app)
- Gravit Designer has “ZERO” AppleScript support.
- I am rebuilding a map from 16,129 individual tiles. Each tile is 256 x 256 pixel. So that basically means there are 127 rows and 127 columns to complete the map.
- User Ignorance should probably have been the first challenge listed
I created a spreadsheet, with two columns - basically the first column is the “X Axis” and the second column is the “Y Axis”.
Then I created a “workspace” using Grid Snapping - each grid is 256 x 256 pixels.
I will manually drag 127 tiles onto the workspace. The tiles appear to be a single entity, but it is all 127 - with the top tile being the topmost tile. Each time I complete the below workflow, I will drag the next 127 columns to the exact same position in the workspace - This allows me to later in the workflow use the “Activate Application” and then the “Move and Click” actions without any alterations necessary.
The first Action in KM would be an “Execute AppleScript”.
AppleScript would activate my Numbers spreadsheet and save the value of cell A1 to a variable (firstCol) and then it would save the value of B1 to a variable (secondCol).
My assumption is that I then must take both AppleScript Variables and make them KM Variables - this is one of the places I just can’t wrap my head around.
The next Action in KM would be to “Activate GravitDesigner”.
Followed by another Action, the “Move and Click” action - this action would activate the topmost tile on the stack I manually placed.
And finally, there would be two additional “Move and Click” actions. The first would highlight the “X Axis Position” and paste the firstCol variable - followed by the next “Move and Click” action highlighting the “Y Axis Position” and pasting the secondCol variable.
Once those actions are done, the topmost tile would now be in the correct position.
I would then want to “Loop” the automation to go to the next row on the spreadsheet - reset the two variables - and place the next tile. This loop would do all 127 tiles for a single column.
I would then manually drag the next column to the exact same position on the workspace and run the KM Automation again. Not pictured, but I have columns C and D of my Numbers spreadsheet with the new positions and all I would do is delete the previously used column A and B - in turn moving columns C and D to the A and B position - this way nothing would need to be changed in the workflow.
I hope the above makes sense and I explained it properly - if not, please let me know if you need further details. Also, if there are easier options for me to consider - please don’t hesitate to let me know.
“TMI Zone”: Just in case anyone is wondering … I am a Disabled Vet, had my “bell rung” one to many times and it has caused some lasting cognitive deficits. A therapist has encouraged me to do two things: use my “techy” gadgets to help with reminders - hence why I love AppleScripting and Keyboard Maestro - my only issue is once I learn something it doesn’t always stick these days.
The other thing she recommended was “Game Therapy” - never knew it was a real thing - but, computer games can help by “exercising” the damaged areas of my brain, as well as hand eye coordination. So the above project has me using automation to make gaming a bit easier for me. The game is called Black Desert Online (BDO) and I wanted a map on my computer which I can use for different tasks. Again, probably TMI - but I just wanted to put some context on why I am working on this project.
Thanks in advance for any help!