Hi i'm trying to do this for few hours but without luck
i wanna automate procces of program youtube-dl (cmd program for downloading youtube video)
command line go like this
C:\youtube-dl.exe https://www.youtube.com/watch?v=jQx3GVqDWlU
can eventghost, when i copy link, to do all this for me
i managed to make script to capture clipboard in variable (i'm not sure that variable part is good)
import win32clipboard
# get clipboard data
win32clipboard.OpenClipboard()
eg.globals.myVar = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()
and then with python command i printed that variable
print eg.globals.myVar
i saw in eventghost log that everything is ok. but in the next action when i wrote command line i didnt get any results
C:\youtube-dl.exe eg.globals.myVar
so please tell me where i'm doing wrong?
Also side question..my youtube-dl.exe is on desktop and when i do cmd operation outside eventghost video will download in desktop, but when i do command line operation in eventghost, my video will download in eventghost folder in appdata, roaming if i remember. how to change that so video can download where i want?
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Paste clipboard in Windows Command
Re: Paste clipboard in Windows Command
When you need to access Python variables you need to use curly braces, like this:drobor wrote:i saw in eventghost log that everything is ok. but in the next action when i wrote command line i didnt get any results
C:\youtube-dl.exe eg.globals.myVar
so please tell me where i'm doing wrong?
Code: Select all
C:\youtube-dl.exe {eg.globals.myVar}Re: Paste clipboard in Windows Command
Its working now.. one more thing, is it possible to make an event that will trigger that macro..
so when clipboard change eventghost will read url and if url have in words like "youtube" or "watch" it will make an event that will trigger my macro
do i need python script for this, do i need that words to put in new variable?
so when clipboard change eventghost will read url and if url have in words like "youtube" or "watch" it will make an event that will trigger my macro
do i need python script for this, do i need that words to put in new variable?
Re: Paste clipboard in Windows Command
When you copy something an event is triggered in eventghost - you could use that. Unsure about the URL part thodrobor wrote:Its working now.. one more thing, is it possible to make an event that will trigger that macro..
so when clipboard change eventghost will read url and if url have in words like "youtube" or "watch" it will make an event that will trigger my macro
do i need python script for this, do i need that words to put in new variable?
Re: Paste clipboard in Windows Command
Greatdrobor wrote:Its working now..
Just remembered I had this test code:one more thing, is it possible to make an event that will trigger that macro..
so when clipboard change eventghost will read url and if url have in words like "youtube" or "watch" it will make an event that will trigger my macro
do i need python script for this, do i need that words to put in new variable?
Code: Select all
import win32clipboard
import re
# get clipboard data
win32clipboard.OpenClipboard()
result2 = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()
if re.match(r"https?://www\.youtube\.com/watch\?v=",result2,re.IGNORECASE):
eg.TriggerEvent(u'FoundURL', payload=result2)Create a macro, put the code in a "Python script" action and add a "System.ClipboardChanged" event.
jonib
