/*

/*

Quick Message

This script will send a preformatted message to someone.

you will need to use this sweet app to give the launcher SEND_SMS permission.

https://play.google.com/store/apps/details?id=com.faendir.lightning_launcher.permission_manager

Make sure you read the app description*/

LL.bindClass(“android.net.Uri”);

LL.bindClass(“android.content.Intent”);

LL.bindClass(“java.language.IllegalArgumentException”);

LL.bindClass(“android.telephony.TelephonyManager”);

LL.bindClass(“android.telephony.SmsManager”);

var mctx = LL.getContext();

var num = “######”; // replace with phone#

var message = “This is is a test”; // replace with your message

function check()

{

var service = mctx.getSystemService(Context.TELEPHONY_SERVICE);

// Check if device supports telephony

if (service.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE)

{

alert(“This device doesnt support telephony”);

}

else

{

// continue

}

}

check();

try{

var textMan = SmsManager.getDefault();

textMan.sendTextMessage(num, null, message, null,null);

Android.makeNewToast(“Sent”, false).show();

}catch(e){

alert(e);

}

https://play.google.com/store/apps/details?id=com.faendir.lightning_launcher.permission_manager
« (Previous Post)
(Next Post) »

9 Commentsto /*

  1. Jay M says:

    More of my scripts can be found in the private community.

  2. Working fine.

    I’ll look on how to display/change the phone number and the text

  3. Jay M says:

    Lines 18 and 20 just change the value between the quotes.

  4. Jay M displaying default value and allowing to change,like in variable editor by TrianguloY​

  5. Jay M says:

    Never seen it

  6. Jay M says:

    I think I get ya so instead of having to edit the actual script to change the values for the var and message variables you want me to display a dialog so you can quickly change them instead?

  7. Jay M it’s up to you.

    I’ve changed your script for reading 2 variables I’m updating using variable editor.

    So it’s now useable in Tasker.

    A variant with variable edition could be very interesting.

  8. Jay M says:

    Will probably change it later now I know it works I can improve it.

Leave a Reply

Your email address will not be published. Required fields are marked *