/*
/*
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);
}
More of my scripts can be found in the private community.
Working fine.
I’ll look on how to display/change the phone number and the text
Lines 18 and 20 just change the value between the quotes.
Jay M displaying default value and allowing to change,like in variable editor by TrianguloY
Never seen it
Jay M here
http://www.lightninglauncher.com/wiki/doku.php?id=script_variable_editor
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?
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.
Will probably change it later now I know it works I can improve it.