Hello Pete,
Intent's are tricky, as it's just a wrapper for the Android service. You will have to dive into the Intent dev docs to learn more.
Here's how you can open Spotify:
try {
var i = intent("android.intent.action.VIEW");
i.data("spotify:"); // This URI opens Spotify without specifying a specific track or playlist
i.send();
} catch (error) {
message("Unable to open Spotify. Error: " + error.message);
}
Here's how you can send an email with proper formatting for adding things like tables, more than just sending basic text to the email client.
// Set the email recipient
// Set the email subject
var emailSubject = "Order Request";
// Set the email body
var emailBody = "Hello,\n\nWe would like to place an order. Please see the details below.\n\nBest regards,\nYour Name";
// Format the mailto link
var mailtoData = "mailto:" + emailRecipient + "?subject=" + encodeURIComponent(emailSubject) + "&body=" + encodeURIComponent(emailBody);
try {
var i = intent("android.intent.action.SENDTO");
i.data(mailtoData);
i.send();
} catch (error) {
message("Unable to send email. Error: " + error.message);
}
If you need to find the package name, I recommend the app Package Name Viewer on the play store.
Best Regards,
Brandon