Viscouse Posted Sunday at 09:45 PM Posted Sunday at 09:45 PM (edited) I tried, but I can't seem to crack this, what I think should be a pretty easy line of code. Also, /c can be replaced with /k, making no difference in any code below. First, this works to pull the URL, pass it to @comspec and correctly open a window Opt("WinTitleMatchMode", 2) Opt("SendKeyDelay",9) if winexists("Flickr - Google Chrome","") = 0 Then Exit WinActivate("Flickr - Google Chrome","") send("!d^c");Extract URL flickr RunWait(@ComSpec & " /c gallery-dl " & ClipGet()) First a question: Does comspec accept variables with a string? Because I think an easy solution would be to build a string and just pass it. The code below does not work. $u=https://www.flickr.com/photos/bm-mocs/46714523754/ RunWait(@ComSpec & " /c gallery-dl " & $u) Ultimately, what I want is this: $lots = "@ComSpec /c gallery-dl -o keywords.title="Spring" -o filename="{filename} {title}.{extension}" & Clipget()) ;or really: $lots = "@ComSpec /c gallery-dl -o keywords.title=$variable -o filename="{filename} {title}.{extension}" & Clipget()) ;so I am able to change $variable to different words. I understand readers may not know gallery-dl. At the command line, this sequence works: C:\gallery\gallery-dl -o keywords.title="Spring" -o filename="{filename} {title}.{extension}" https://www.flickr.com/photos/bm-mocs/46714523754/ Edited Sunday at 09:56 PM by Viscouse
Solution ioa747 Posted yesterday at 04:35 AM Solution Posted yesterday at 04:35 AM (edited) you may need a little Sleep time, so that the clipboard contents can catch up Also a good tactic is to put a ConsoleWrite so that you can check the contents of the command line (for debugging purposes) Opt("WinTitleMatchMode", 2) If Not WinExists("Flickr - Google Chrome") Then Exit WinActivate("Flickr - Google Chrome") Send("!d^c") Sleep(100) Local $sCMD = 'gallery-dl "' & ClipGet() & '"' ConsoleWrite("$sCMD=" & $sCMD & @CRLF) RunWait(@ComSpec & ' /c ' & $sCMD) Edit: ; C:\gallery\gallery-dl -o keywords.title="Spring" -o filename="{filename} {title}.{extension}" https://www.flickr.com/photos/bm-mocs/46714523754/ Local $sProgramPath = "C:\gallery\gallery-dl" Local $sTitle = "Spring" Local $sURL = "https://www.flickr.com/photos/bm-mocs/46714523754/" $sCMD = $sProgramPath & ' -o keywords.title="' & $sTitle & '" -o filename="{filename} {title}.{extension}" ' & $sURL ConsoleWrite("$sCMD=" & $sCMD & @CRLF) ;~ RunWait(@ComSpec & ' /c ' & $sCMD) Edited yesterday at 05:03 AM by ioa747 I know that I know nothing
Viscouse Posted yesterday at 05:09 PM Author Posted yesterday at 05:09 PM Thank you ioa747. That worked! ioa747 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now