Topics - Nod5 [ switch to compact view ]

Pages: prev1 ... 3 4 5 6 7 [8] 9 10 11 12 13 ... 22next
36
This alias lets you enter
yt https://www.youtube.com/watch?v=dQw4w9WgXcQ
in FARR to download that youtube content to an mp3 audio file.

This requires the tools youtube-dl (to download the youtube content) and ffmpeg (to convert to mp3).
youtube-dl , http://rg3.github.io/youtube-dl/download.html
ffmpeg , http://ffmpeg.zeranoe.com/builds/ (get the Static build)

alias name
youtube-dl to mp3
regular expression pattern
^(?:y|yt|you) (.*(?:youtu.be|youtube.com).*)$
Results
youtube-dl mp3 $$1 | C:\folder\youtube-dl.exe --restrict-filenames -o "C:\output\`%(title)s.`%(ext)s" --write-thumbnail --ffmpeg-location "C:\folder\ffmpeg.exe" -f "bestaudio[ext=m4a]" -x --audio-format mp3 --audio-quality 0 --embed-thumbnail $$1

Note: change the two instances of "C:\folder\" to where you have put youtube-dl.exe and ffmpeg.exe (and ffprobe.exe and ffplay.exe from the same package) and change "C:\output\" to what folder you want the mp3 file to end up in.

I also made a short video tutorial on how to do these setup steps, view it here
https://www.youtube.com/watch?v=dQw4w9WgXcQ

37
FARRCloseSelProc is a FARR helper tool that closes a process that matches the filename of the file that is selected in Explorer.

This is useful if you work on some code that you need to repeatedly compile, run and later close the process of before the next test run. But it can also be used to quickly close a process that you know the name of.

Setup:
1 paste the code into a text editor and save as FARRCloseSelProc.ahk and then compile it (you need http://ahkscript.org/ for that).
2 store the compiled FARRCloseSelProc.exe in some folder
3 create a FARR alias like this

alias name:
proc close
regex pattern:
^proc(?: |)(.*|)$
result box:
CloseSelProc $$1| C:\some\folder\FARRCloseSelProc.exe $$1 %LASTHWND%

To use it open Explorer and select a file you want to close a matching process for. For example select the file program.exe if you want to close the process program.exe . Press your FARR hotkey, type "proc" and when the alias shows press enter.
To use it by typing a process name press your FARR hotkey, type "proc program.exe" and press enter.

Note:
- The typed process name must match exactly. It must not have any spaces in the name.
- If there are multiple processes with that name only the first one detected by autohotkey will be closed.

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance force

x = %1%  ;hwnd parameter from FARR or exact name of a process from FARR
y = %2%  ;hwnd (if first param is exact name)

;FARRCloseSelProc -- a helper tool for FARR
;This tool is made to be run from a FARR alias.

if x =
 exitapp
if y ;filename mode
 splitpath, x, pname,,pext
else ;HWND mode
{
WinGetClass, xclass, ahk_id %x%
if xclass != CabinetWClass  ;exit if not Explorer win
 exitapp
WinActivate, ahk_id %x%,
ifwinNotactive, ahk_id %x%
 exitapp
clip := ClipBoardAll 
clipboard =
send ^c   ;copy
clipwait, 2
if errorlevel != 0
 exitapp
Loop, Parse, clipboard, `n, `r
{
p := a_loopfield
break
}
clipboard := clip ;restore
if InStr( FileExist(p), "D")
 exitapp
splitpath, p, pname,,pext
}

if (pext != "exe")
 exitapp

Process, close, %pname%
Loop, 10
{
Process, Exist, %pname%
if errorlevel = 0
break
sleep 100
}
Process, Exist, %pname%
if errorlevel = 0
 tooltip, Closed process %pname%
else
 tooltip, ERROR. Process %pname% still running.
sleep 2000
exitapp

38
FARRCloneWithDatestamp is a FARR helper tool to make a datestamped copy of a currently selected file in Explorer. The copy is placed in the same folder.

Have you ever done ctrl+C ctrl+V on a file and then edited its name, perhaps added a datestamp in order to keep track of which copy is more recent than the others? Then this might just be a tool for you.  :)

Setup:
1 paste the code into a text editor and save as FARRCloneWithDatestamp.ahk and then compile it (you need http://ahkscript.org/ for that).
2 store the compiled FARRCloneWithDatestamp.exe in some folder
3 create a FARR alias like this

alias name:
clone
regex pattern:
^(clo|clon|clone)$
result box:
Clone selected with datestamp | C:\some\folder\FARRCloneWithDatestamp.exe %LASTHWND%

To use it open Explorer and select a file you want to create a clone of. Press your FARR hotkey, type "clo" and when the alias shows press enter.
Next to your "file.txt" you should now see "file -- 20151213092801.txt" .

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance force

x = %1%  ;hwnd parameter from FARR 

;FARRCloneWithDatestamp -- a helper tool for FARR
;what it does:
;focus the window that matches input parameter hwnd
;if explorer window: get selected files, parse first file
;make a copy of "file.ext" as
;"file -- [datestamp yyyymmddhhmmss].ext" in the same folder
;report status, exit

if x =
 exitapp
WinGetClass, xclass, ahk_id %x%
if xclass != CabinetWClass  ;exit if not Explorer win
 exitapp
WinActivate, ahk_id %x%,
ifwinNotactive, ahk_id %x%
 exitapp

clip := ClipBoardAll
clipboard =
send ^c   ;copy
clipwait, 2
if errorlevel != 0
 exitapp

Loop, Parse, clipboard, `n, `r
{
p := a_loopfield ;first file in selection
break
}
clipboard := clip ;restore

if InStr( FileExist(p), "D")
 exitapp
splitpath, p, pname,pdir,pext,pnoext
FileCopy, %p%, %pdir%\%pnoext% -- %A_now%.%pext%
if !Errorlevel
 tooltip, Clone %pdir%\%pnoext% -- %A_now%.%pext% created
else
 tooltip, ERROR. Failed to clone %pname%
sleep 2000
exitapp

39
aria2 is "a lightweight multi-protocol & multi-source command-line download utility". It can speed up download of large .iso files by using multiple threads.

Get and unzip aria2 and make a new alias in FARR with these settings

name:
dl

regular expression pattern:
^dl (.*)$

Results:
dl aria2 $$1 | C:\folder\aria2c.exe -x 15 -s 15 -k 3M -d C:\downloads "$$1"

Note: change C:\folder\ and C:\downloads\ to match the folders on your computer. You can tweak the number of threads to use (-x -s values) and split file size (-k value) to max out your internet speed. Details on aria2 man page.

To use it put a file URI on the clipboard, open FARR and type "dl " and paste the url. A command line window pops up and shows the download progress.

40
Find And Run Robot / request: allow FARR searches with options open
« on: January 21, 2015, 07:24 AM »
While the FARR options window is open FARR search is disabled. Is that necessary? Could it be worked around? When creating more advanced aliases it is handy to search for files with FARR. But to do so one has to exit/reopen the options inbetween.

Pages: prev1 ... 3 4 5 6 7 [8] 9 10 11 12 13 ... 22next
Go to full version