I am working on a macro to scrape weekly comic release lists at the Marvel Database wikia. The macro scrapes the data, formats it for my Excel spreadsheet and then pastes it into the spreadsheet from a KM named clipboard. All of that works just fine, except...
My spreadsheet starts with 2 columns that have to be filled in manually after the rows are added, so I leave them as tabs in the output from the macro. But it seems like Keyboard Maestro is eating those initial tabs on the first line of the output.
(I suppose I could just adjust the paste into Excel step so it starts from the 3rd column instead of the 1st, but now I'm mad about this and I'm determined to bend it to my will.)
If I run my macro and dump the output to a text window and then copy/paste into BBEdit, this is what I see:
You can see that the first line is missing tabs but subsequent lines aren't.
If I allow the macro to paste directly into Excel, same thing:
I am at a loss what could be causing this. Any ideas?
I just had the thought to try saving the results of the page scraping to a KM variable instead of a named clipboard and then just set the value of the correct cell in Excel to the value of the variable, thus bypassing the clipboard altogether.
Nope, same problem. So it's not just the clipboard, I guess. Does KM trim whitespace from the front of variables and clipboard contents?
Slurp new comics list.kmmacros (7.3 KB)