Here's how I think it should work:
- Select several files in Directory Opus (a Windows Explorer replacement)
- Copy the list of file names (DOpus does this with a shortcut)
- Parse the list
- Open a Chrome Tab with an Amazon Search window for each file name
However, my run command to open the Chrome tab with the Amazon search window fails.
Here's a list of sample files:
Code: Select all
Gary Noesner - Stalling for Time.epub
Geoffrey Gray - Skyjack.mobi
Greg B. Smith - Made Men.mobi
Greg B. Smith - Nothing but Money.mobi
Gregg Olsen - Starvation Heights.epub
Code: Select all
DIRECTORY_OPUS: ; This label is for the DOpus section of a much larger script
#IfWinActive ahk_exe dopus.exe ; The DOPus section has several commands, only 1 is included below
^+!A::gosub SearchAmazonBooks ; I have a mouse button permanently configured to send ^+!A
; I included everything above this line in case it's interfering, but I don't think it is
SearchAmazonBooks: ; This label is for the command that needs to be fixed
AmazonBookList :=
AmazonBookListResults :=
AmazonSearchURL :=
Clipboard :=
Send, ^+n ; DOpus shortcut to copy list of file names
ClipWait, 2
If ErrorLevel {
MsgBox, 48, Error, An error occurred while waiting for the clipboard.
Return
}
AmazonBookList := RegExReplace(Clipboard, "\.(epub|mobi)", "")
AmazonBookList := RegExReplace(AmazonBookList, "`r`n", "|")
;-msgbox %AmazonBookList%
Loop, Parse, AmazonBookList, |
{
AmazonSearchURL := "https://www.amazon.com/s?k="StrReplace(A_LoopField, " ", "+")"&i=stripbooks&crid=3H4O3DBRM5QUR&sprefix=testsearch%2Cstripbooks%2C67&ref=nb_sb_noss_1"
Run, chrome.exe %AmazonSearchURL%, C:\Program Files (x86)\Google\Chrome\Application
}
return
Update: I made a correction to the trigger so it actually calls the label SearchAmazonBooks, I added some notes and I removed the counter part of the script.