BASIC! to MacroDroid & MacroDroid to BASIC!

By Rickey Estes

This code will let BASIC! communicate with MacroDroid via CLIPBOARD.PUT.

See BASIC! to MacroDroid and BASIC! to MacroDroid for further details.

[CODE]CONSOLE.TITLE “MacroDroid It!”
BBBASZG$ = “/DROIDEDIT/”

FILE.EXISTS b, BBBASZG$

IF b = 0 THEN FILE.MKDIR BBBASZG$

AIMACRODROIDX1:
array.delete AIYNC$[]
array.load AIYNC$[], “View Message List”, “Add A New MacroDroid Message”, “Cancel”, “”
SELECT s, AIYNC$[], “Make A Selection”
IF s = 0 THEN GOTO AIMACRODROIDX1
IF s = 1 THEN GOTO AIMACRODROIDX3
IF s = 2 THEN GOTO AIMACRODROIDX2
IF s = 3 THEN GOTO AIMACROCANCEL
IF s = 4 THEN GOTO AIMACRODROIDX1

AIMACRODROIDX2:
INPUT “Enter MacroDroid Message:”, APP$
TEXT.OPEN A, FNZ1, “/DROIDEDIT/AIMACRODROID.txt”
TEXT.WRITELN FNZ1, APP$
TEXT.CLOSE FNZ1

AIMACRODROIDX3:
FILE.EXISTS FNZ1, “/DROIDEDIT/AIMACRODROID.txt”
IF FNZ1 = 0 THEN GOTO AIMACRODROIDX4
LET AIMDCTR = 0
TEXT.OPEN R, FNZ1, “/DROIDEDIT/AIMACRODROID.txt”
DO
TEXT.READLN FNZ1, APP$
IF APP$ = “EOF” THEN D_U.BREAK
LET AIMDCTR += 1
UNTIL APP$ = “EOF”
TEXT.CLOSE FNZ1

ARRAY.DELETE p$[]
DIM p$[AIMDCTR]
TEXT.OPEN R, FNZ1, “/DROIDEDIT/AIMACRODROID.txt”
FOR I = 1 TO AIMDCTR step 1
TEXT.READLN FNZ1, APP$
p$[I] = APP$
IF APP$ = “EOF” THEN F_N.BREAK
NEXT I
TEXT.CLOSE FNZ1

SELECT s, p$[], “Make A Selection.”
IF s = 0 THEN GOTO AIMACRODROIDX1
APP$ = p$[s]

APP$ = “MacroDroid LAUNCH ” + APP$
CLIPBOARD.PUT APP$

AIMACROCANCEL:
END

AIMACRODROIDX4:
array.delete AIYNC$[]
array.load AIYNC$[], “Add The First MacroDroid Message”, “Cancel”, “”
SELECT s, AIYNC$[], “No Message List Found.”
IF s = 0 THEN GOTO AIMACRODROIDX4
IF s = 1 THEN GOTO AIMACRODROIDX2
IF s = 2 THEN GOTO AIMACROCANCEL
IF s = 3 THEN GOTO AIMACRODROIDX4
[/CODE]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s