View Single Post
Old 11-11-2018, 04:25 AM   #308
notimp
Addict
notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.
 
Posts: 248
Karma: 892441
Join Date: Jul 2010
Device: K2i
For the unlikely instance that anyone would like an applescript program to pull screenshots from the Likebook Mars (or indeed any android device) via adb (developer options have to be enabled on the Likebook, as well as USB debugging, adb has to be installed on the computer thats connecting via adb (and USB), the on screen security prompt on the ereader for a device connecting via adb has to be granted - then its plain sailing.. (screenshots will show up in a boyue folder on the desktop) ) -- here you go :

Code:
tell application "Terminal"
	do script "echo i can haz screencaps"
end tell
tell application "System Events"
	tell application process "Terminal"
		set frontmost to true
		keystroke "h" using command down
	end tell
end tell
do shell script "/bin/sleep 1.7"
do shell script "adb shell screencap -p /sdcard/screencap.png"
do shell script "mkdir -p ~/Desktop/boyue"
do shell script "adb pull /sdcard/screencap.png ~/Desktop/boyue/screencap.png"
set theFolder to alias "Macintosh HD:Users:notimp:Desktop:boyue:"
tell application "Finder"
	set k to 0
	repeat with thisFile in (get document files of theFolder that name contains "screencap" and name extension is "png")
		set k to k + 1
		get name extension of thisFile
		if name of thisFile contains "screencap" then
			set name of thisFile to "screencap " & k & "." & result
		end if
	end repeat
end tell
do shell script "adb shell rm /sdcard/screencap.png"
do shell script "killall Terminal"
Dont forget to replace notimp with your MacOS Username.

Last edited by notimp; 11-11-2018 at 07:18 AM.
notimp is offline   Reply With Quote