Created
August 27, 2014 00:00
-
-
Save codebutler/58c2ef7fc0e51a9bcfda to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set adb to "/usr/local/bin/adb" | |
| set impbcopy to "/Users/ericbutler/.bin/impbcopy" | |
| set {oldtid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return} | |
| set rawDevices to do shell script adb & " devices | tail -n +2 | grep -v '^$' | awk -F\\ '{ print $1 }'" | |
| set devices to every text item of rawDevices | |
| set AppleScript's text item delimiters to oldtid | |
| set device to item 1 of {choose from list devices with prompt "Select Device:"} | |
| if device is not false then | |
| do shell script adb & " -s '" & device & "' shell screencap -p | perl -pe 's/\\x0D\\x0A/\\x0A/g' | " & impbcopy & " -" | |
| display dialog "Screenshot copied to clipboard!" buttons {"OK"} | |
| end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment