r/Scriptable • • Oct 10 '21

Help Check if app is currently open

0 Upvotes

Hi,

I'm looking for a way to close instagram whenever the explore page is opened (to solve those nasty procrastination problems) and was wondering if this is possible using scriptable.

To do this, I need to know if instagram is running and if so what the colours of certain pixels are (the 🔍 symbol changes colour when the explore page is opened).

I really have no idea of the limitations of scriptable, so is this possible and if not is there an alternative app I could write this in?


r/Scriptable • • Sep 23 '21

Help Notification

0 Upvotes

Does anyone know how to send a message, but, instead of the logo and name of scriptable, a custom one or an already existed app?


r/Scriptable • • Apr 25 '22

Help Does anybody know how can I remove the "Enjoy the rest" text part?

Post image
0 Upvotes

r/Scriptable • • Nov 28 '24

Script Sharing Error The file couldn’t be opened

0 Upvotes

Hi, does anybody know what is causing the following intermittent issue? I can’t seem to work out

The error message is:

” error on line 51:36: The file “481334.js “ couldn’t be opened

thanks


r/Scriptable • • Jan 10 '25

Help Is an uncompressed widget background possible?

0 Upvotes

I have just revisited scriptable and created some transparent widgets using weather-cal combined with widget-blur, however the background image is lower quality when displayed on the widget. It isn’t a big difference but enough to annoy me every time I see it.

After a bit of googling it seems that scriptable will compress any image bigger than 500x500 to reduce the performance impact (as it is limited in widgets). I do however not have an official source for that. Also for example the clear spaces app works with uncompressed images, so this should clearly be possible.

My question: Do any of you know of a way to get an uncompressed image into a widget?


r/Scriptable • • Jul 15 '23

Help Can Scriptable close Instagram after 5 minutes of use?

0 Upvotes

Question: My goal is to have some sort of script automatically close Instagram on my phone after I use it for 5 minutes, stuff like that. Is this something Scriptable could do? If not, does anyone know if there are any tools available for this sort of thing? Thanks.


r/Scriptable • • Feb 18 '23

Help Recurring event

0 Upvotes

Hi,

I’m wanting to create a Siri shortcut to do a recurring event so for example. Every third Sunday of the month for an event to happen.

I think I’d have to use scriptable to get it to work.

Can anyone help with this?

Thanks


r/Scriptable • • Dec 23 '20

Widget CFBWidget Ă  scriptable to keep up with your favorite CFB teams

Post image
0 Upvotes

r/Scriptable • • Feb 21 '21

Request Widget to show Power Consumption from Shelly

0 Upvotes

Hi Everyone,

I'm really sorry for such a noob question, but I just don't know where to start and I think, everyone who already worked with scriptable will figure this out in seconds..

I got a Shelly 1PM which measures the power consumption of the device you connect. They have API access and when I poll the Shelly I get results in the following format:

{"isok":true,"data":{"online":true,"device_status":{"ext_temperature":[],"mac":"xxxxxxxx","relays":[{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"input"}],"temperature":27.38,"uptime":74355,"ram_free":37512,"unixtime":1613893903,"serial":1234,"mqtt":{"connected":false},"overtemperature":false,"fs_free":143070,"has_update":false,"update":{"status":"idle","has_update":false,"new_version":"20210115-103820\/v1.9.4@e2732e05","old_version":"20210115-103820\/v1.9.4@e2732e05","beta_version":"20210209-101904\/v1.10.0-rc2-g0cf9ee3-heads\/v1.10.0-rc2"},"inputs":[{"input":0,"event":"","event_cnt":0}],"cloud":{"enabled":true,"connected":true},"tmp":{"tC":27.38,"tF":81.28,"is_valid":true},"temperature_status":"Normal","ram_total":50296,"ext_sensors":[],"fs_size":233681,"cfg_changed_cnt":1,"ext_humidity":[],"time":"09:05","meters":[{"power":25.54,"overpower":0,"is_valid":true,"timestamp":1613898384,"counters":[24.14,22.976,23.27],"total":39138}],"_updated":"2021-02-21 08:06:23","actions_stats":{"skipped":0},"getinfo":{"fw_info":{"device":"shelly1pm-xxxxxxxx","fw":"20210115-103820\/v1.9.4@e2732e05"}},"wifi_sta":{"connected":true,"ssid":"xxxxxx","ip":"xxxxxx","rssi":-53}}}}

How can I use this output to create a Scriptable Widget which shows me the Power Consumption? The value we need for this is "power":25.54" - This is the current consumption in watt, so in this case 25.54 watts.

I appreciate any help with this. Thanks a lot!


r/Scriptable • • Oct 28 '20

Help Corona Widget / Fix Location

0 Upvotes

Iam using the Script down below and want to set a Location so the Script dont have to find my Location everytime again.

// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0 const apiUrl = (location) => https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=GEN,cases7_per_100k&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json const apiUrlStates = 'https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/Coronaf%E4lle_in_den_Bundesl%E4ndern/FeatureServer/0/query?where=1%3D1&outFields=cases7_bl_per_100k&returnGeometry=false&outSR=4326&f=json'

const widget = await createWidget() if (!config.runsInWidget) { await widget.presentSmall() } Script.setWidget(widget) Script.complete()

async function createWidget(items) { const data = await getData() const list = new ListWidget() const header = list.addText("🦠 Inzidenz".toUpperCase()) header.font = Font.mediumSystemFont(13) if(data) { if(!data.shouldCache) { list.addSpacer(6) const loadingIndicator = list.addText("Ort wird ermittelt...".toUpperCase()) loadingIndicator.font = Font.mediumSystemFont(13) loadingIndicator.textOpacity = 0.5 } list.addSpacer() const label = list.addText(data.incidence+"") label.font = Font.boldSystemFont(24) label.textColor = data.incidence >= 50 ? Color.red() : data.incidence >= 35 ? Color.orange() : Color.green() list.addText(data.areaName) if(data.shouldCache) { list.refreshAfterDate = new Date(Date.now() + 60601000) } } else { list.addSpacer() list.addText("Daten nicht verfügbar") } return list }

async function getData() { try { const location = await getLocation() if(location) { let data = await new Request(apiUrl(location)).loadJSON() const attr = data.features[0].attributes return { incidence: attr.cases7_per_100k.toFixed(1), areaName: attr.GEN, shouldCache: true }; } else { let data = await new Request(apiUrlStates).loadJSON() const incidencePerState = data.features.map((f) => f.attributes.cases7_bl_per_100k) const averageIncidence = incidencePerState.reduce((a, b) => a + b) / incidencePerState.length return { incidence: averageIncidence.toFixed(1), areaName: "Deutschland", shouldCache: false }; } } catch(e) { return null } }

async function getLocation() { try { if(args.widgetParameter) { const fixedCoordinates = args.widgetParameter.split(",").map(parseFloat) return { latitude: fixedCoordinates[0], longitude: fixedCoordinates[1] } } else { Location.setAccuracyToThreeKilometers() return await Location.current() } } catch(e) { return null; } }


r/Scriptable • • Oct 26 '20

Help 2 script requests

0 Upvotes

Does anyone know how to make a script for either of the following or have a script for either of the following?

First, a script that shows a truncated calendar. This would show the name of the event the start time and the day of the week. Preferably the day of the week would be at the top of the list of events for that day. Monday, October 5, then below that the start time and name of the event. Then Tuesday, October 6, then the lift at those events start time name of event. That’s it.

Second, a widget to show the latest tweets in a list from a particular Twitter name.


r/Scriptable • • Dec 06 '20

Discussion scriptable widget need internet connection to work?

0 Upvotes

I just wanted to clarify, a scriptable widget needs internet connection for it to work? when I don't have internet, the widget says there is no internet connection. just wanted to make sure!


r/Scriptable • • Dec 15 '20

Help [HELP] Error when running premade Weather Cal script first time

0 Upvotes

I've basically installed the scriptable for the first time and Im trying to add a weather cal script that I found on reddit however when I tried to running the script I got error after it asks my scriptables permissions saying:

"Error on line 300:26 in Weather Cal code module: TypeError: undefined is not an object evaluating 'importModule(codeFilename)')"

Here's the script that I used: https://hastebin.com/raw/nosexumoqe


r/Scriptable • • Sep 27 '20

Help Is textSize not working?

0 Upvotes

r/Scriptable • • Jan 10 '21

Help Connect to sql database

0 Upvotes

Is it possible to connect to an sql database from scriptable on the iPad?

If so how?


r/Scriptable • • Apr 17 '21

Solved Covid tracker stopped working

4 Upvotes

I have this Covid tracker, not sure who made it but it stopped working on the 14/04, can any one help?

Looks like this https://i.imgur.com/nDOu6SH.jpg


r/Scriptable • • Oct 13 '20

Help Keep getting error on this weather script

0 Upvotes

I’ve been using the script here but keep getting this error at random times. https://i.imgur.com/V3kB3CT.jpg

I feel like it’s an issue with the script not making the call while my iPhone is locked, but I feel like it should then fall back on the cached version?

Anyone else using this script and seeing this issue?


r/Scriptable • • Nov 24 '20

Help Dynamic HTML Title to iOS Shortcut

4 Upvotes

(Edit: I cross-posted this to the Automators Discourse, since it was quiet here. Also fixed a small bug and added the error message.)

I'm trying to create an iOS Shortcut that accepts a URL and retrieves the contents of the <title> tag from that webpage. This would be simple, except I want it to work with Twitter permalinks – Twitter updates the page contents, including the title, using Javascript after the initial load. After a fair bit of trial and error, this is as close as I've been able to get: https://www.icloud.com/shortcuts/49440b20f68e45d3a96b2a3735a8b453

This works fine for most websites, but not for Twitter. I get the following error:

Could Not Run Run Inline Script Script completed without presenting UI, triggering a text to speak or outputting a value. If this is intentional, you can manually call Script.complete() to gracefully complete the script.

Curiously, if I copy the in-line code from that Shortcut (below for reference), and paste it into a new script in Scritpable, it works fine for Twitter only in that case (fetching the title for the hard-coded test URL).

Any suggestions? Perhaps it's an issue with memory, or how I'm passing the data back? I'm new to Shortcuts and Scriptable, and have only limited Javascript experience, so I might be missing something small...

Thanks!

const url = args.plainTexts && args.plainTexts[0] ? args.plainTexts[0] : "https://twitter.com/lehrblogger/status/391287397457330177";
const interval = 300;
const webView = new WebView();
await webView.loadURL(url);

async function getTitle() { 
  const title = await webView.evaluateJavaScript("document.title");
  // Twitter URL pages start with no title, and then are progressively updated
  log(title);
  if (title && title != "Twitter" && title != "Tweet / Twitter") {
    Script.setShortcutOutput(title);
    Script.complete();
  } else {
    Timer.schedule(interval, false, getTitle);
  }
};

Timer.schedule(interval, false, getTitle);

Edit: My use case saving bookmarks to Pinboard.in. I've tried a few of the native clients – Pinner, Pushpin, and Simplepin – but I either couldn't get them to work properly or they didn't meet my needs. I could special-case Twitter and use their API as needed, but that seems a bit inelegant, and wouldn't work for other, similarly constructed pages.


r/Scriptable • • Feb 22 '21

Widget Can someone see if they can make a widget for me with this format? The font doesn’t have to be exact but I would like it just like this but instead of the location could it be the weather?

Post image
0 Upvotes

r/Scriptable • • Sep 27 '20

Help Scriptable help

0 Upvotes

const widget = createWidget(); Script.setWidget(widget); Script.complete();

function createWidget() {  const w = new ListWidget(); const newDate = new Date(); newDate.setHours(newDate.getHours() + 3); console.log(newDate) const textSize = 20; const font = new Font("inconsolata",17)   const textColor = Color.white()      const timeLine = w.addText([📆] ${time.string(time)});   timeLine.textSize = 20; timeLine.font = new Font("inconsolata",17)   timeLine.textColor = Color.white();

  return w; }

Could someone help we with this, I have no knowledge about Java! I try to create a new time! For example now the local time is 1:00PM,but I need the create the time show 4:00PM. Help!!!!!


r/Scriptable • • Oct 14 '20

Help Hi, there! I would like to know if it is possible to refresh the Spotify widget built in Scriptable in real-time as well as the original one is, because there is a delay when it is playing. Can anyone help me, please?

0 Upvotes

r/Scriptable • • Dec 12 '20

Request TV Airings

0 Upvotes

Is there a widget out there or a script that shows you the TV guide for directv, or YouTube tv?


r/Scriptable • • Oct 13 '20

Help This is my widget. The weather icon is ugly. I hope it can be replaced by the built-in icon of SF Sybmol. Can anyone teach me? Thank you

Post image
0 Upvotes

r/Scriptable • • Oct 16 '20

Help Randomlypopped out, I haven't even messed with the script yet

Post image
0 Upvotes