Skip to content

Instantly share code, notes, and snippets.

@mrkmg
Created February 13, 2012 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrkmg/1820572 to your computer and use it in GitHub Desktop.
Save mrkmg/1820572 to your computer and use it in GitHub Desktop.
AXEL Apple Script
--Written by Kevin Gravier
--Edit and redistribute as you please but leave this header.
property lastURL : "http://link.to.file"
property lastThreads : 4
set link to text returned of (display dialog "What do you want to download?" buttons {"OK"} default button 1 default answer lastURL with icon 1)
set lastURL to link
set threads to text returned of (display dialog "How many threads?" buttons {"OK"} default button 1 default answer lastThreads with icon 1)
set lastThreads to threads
set diralias to choose folder with prompt "Choose a folder to save the file"
set dir to POSIX path of diralias
tell application "Terminal"
do script "cd " & dir & ";/opt/local/bin/axel -a -n " & threads & " " & link
set the background color of window 1 to "green"
set the normal text color of window 1 to "black"
set the number of columns of window 1 to 80
set the number of rows of window 1 to 6
set the position of window 1 to {0, 20}
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment