(* Freeware AppleScript from WhatsMyIP.org © 2017 Check out our other scripts! @ http://www.whatsmyip.org/lib/applescripts/ Split File is an AppleScript gui wrapper for the `split` command line program *) on open x set x to POSIX path of x set varLines to text returned of (display dialog "How many lines do you want in each file piece?" default answer "100" buttons {"Cancel", "OK"} default button 2 with icon note) set varDestination to choose folder with prompt "Please select where you would like the pieces to go" set varDestination to POSIX path of varDestination set varCommand to "split -a 3 -l " & varLines & " '" & x & "' '" & varDestination & "'" do shell script varCommand display dialog "Split completed successfully." buttons "OK" default button 1 with icon note giving up after 10 end open on run set x to choose file with prompt "Please choose a text based file to split." open x end run