r/Scriptable • • Jan 09 '25

Widget Sharing Upcoming Birthdays from Contacts Widget

Thumbnail
gallery
21 Upvotes

Never forget a friend's birthday again. Add this Script and set it as either Large or Medium. Type "Large" or "Medium" in parameter. The card will change color if someone's birthday is today, and contacts nearing their birthday also turn lighter. As a plus, click the widget to add a birthdate to any contact, or to create a new contact with its birthdate. Note: the widget takes birthdates from your calendar "Birthdays", which takes them from your contacts with birthdates saved.

JavaScript File: https://www.icloud.com/iclouddrive/01cPi6j-MUKwsY5wsdBg4Xy5Q#Upcoming_Birthdays


r/Scriptable • • Jan 01 '24

Widget Sharing I made a Wikipedia 'Top Read' widget

Post image
21 Upvotes

r/Scriptable • • Jun 19 '22

Widget Sharing tagesschau news widget — it shows the current news from the German news site tagesschau.de

Thumbnail
gallery
21 Upvotes

r/Scriptable • • Dec 23 '21

Not Possible Is it possible to make curved text in widgets like the calendar complication on the apple watch?

Post image
21 Upvotes

r/Scriptable • • Nov 16 '21

Widget Plausible analytics widget (Script in the comments)

Post image
21 Upvotes

r/Scriptable • • Oct 11 '20

Script I made a script to add scripts. Here you go. Just share a raw JS file to the script and it will add it to your library.

Thumbnail
drive.google.com
21 Upvotes

r/Scriptable • • Nov 01 '26

Widget Sharing I made a widget that shows my calorie deficit and macro ratings from Apple Health

Post image
20 Upvotes

A Shortcut pulls 7-day averages from Apple Health and saves them as JSON. The Scriptable widget shows:
-average daily deficit or surplus
-expenditure and intake
-macros with a color rating for fat loss + muscle gain
Tap to refresh. Small, medium, large and lock screen, English or German UI. The README also covers my meal-logging Shortcut (describe or photograph food, AI estimates the macros).
I built this together with Claude (AI) as my first GitHub project.
GitHub (MIT): https://github.com/DarthQuintus/scriptable-kcal-widget
Both Shortcuts are linked in the README.
Feedback welcome!


r/Scriptable • • Oct 15 '26

Widget Sharing Miami Heat Next/Current game widget

20 Upvotes

I vibe coded this simple widget to show me when the next heat game is, and give live scores during the game. All the times are in my local time, Melbourne Australia


r/Scriptable • • Aug 08 '21

Widget Widget Markup Library

20 Upvotes

Created a simple library for making Scriptable widgets using html like markup.

https://github.com/rafaelgandi/WidgetMarkup-Scriptable


r/Scriptable • • Mar 11 '21

Request Toggle VPN script

20 Upvotes

Hello, I’ve been looking everywhere to see how I could automate the VPN on. I know that some VPN apps have Siri Shortcuts, but I’m looking for a scriptable script that toggles the VPN so I can call the script from the shortcuts app in an automation. If scriptable can even do it. 🙏


r/Scriptable • • Dec 19 '20

Request Is anyone able to make this widget and send the script

Post image
20 Upvotes

r/Scriptable • • Oct 19 '20

Help Does anyone have script for widget like this ? Google weather/calendar widget - Thanks in advance.

Post image
20 Upvotes

r/Scriptable • • Nov 09 '25

Widget Sharing UK Energy Pricing

Post image
19 Upvotes

Real-time UK energy cost tracker variable-rate tariff (like Octopus Agile), electricity prices change every 30 minutes based on supply and demand.

Pulls live data from two sources: Carbon Intensity API - tells you how dirty the electricity grid is (coal vs. renewables) Octopus Agile API - tells you how expensive electricity is right now

Electricry prices change every 30 minutes based on supply and demand. • Current price (pence per kWh) • Carbon intensity (how green the grid is) • Traffic light system: Green = crack on, Orange = maybe wait, Red = absolutely not • Best/worst time windows for the next 12-24 hours • Graphs showing price trends (historical vs. forecast)

https://github.com/MichaelMatley/IOS-Widgets


r/Scriptable • • Feb 23 '25

Script Sharing Letterboxd Widgets!

19 Upvotes

Since Letterboxd doesn't have any official widgets, I decided to make my own. They're simple to use, just paste the script into Scriptable and change your_username to your Letterboxd username and you're good to go.

https://github.com/akrentz6/LetterboxdWidgets

I'll be adding more functionality in the future, so let me know what you'd like to see.


r/Scriptable • • Jun 02 '24

Widget Sharing Inline Weather Widgets

Thumbnail
github.com
19 Upvotes

Today I finished my weather-script for the lockscreen-widgets. It pulls the datas from the openweathermap API.


r/Scriptable • • Oct 07 '23

Widget Sharing RSS Widget on iOS lockscreen

19 Upvotes

Hi!

I created a simple widget to have my favorite news sites right on the lock screen. A click on the news text opens the article in Safari

My goal was that the design should look similar to Apple's official News widget.

https://i.imgur.com/DBX2kLD.png

You can download it here: https://github.com/leon47331/scriptable-lockscreen-rss-widget


r/Scriptable • • Sep 25 '23

Help Black border around widgets

Post image
19 Upvotes

Anyone else randomly get a black border around their widgets? It completely messes up the styling.


r/Scriptable • • Feb 08 '22

Widget Sharing Uniswap V3 pool position monitor

Post image
19 Upvotes

r/Scriptable • • Aug 07 '21

News Scriptable v1.6.4 has been released with bug fixes and some new enhancements to the Alert API

Thumbnail
twitter.com
19 Upvotes

r/Scriptable • • Mar 14 '21

Help How to make this script look like calendar-widget-design? Code in comments

Post image
19 Upvotes

r/Scriptable • • Jan 02 '21

Widget Some vaccination stats

Thumbnail
gallery
19 Upvotes

r/Scriptable • • Dec 04 '20

Request Code available?

Post image
19 Upvotes

r/Scriptable • • Sep 25 '20

Help (Solved) Would anyone know how to add a weather temperature and possibly conditions? And make it fit in the top left of this widget? (Ive never coded before but I think this widget style is really cool and would appreciate help)

Post image
19 Upvotes

r/Scriptable • • Dec 25 '25

Script Sharing Release: Clean Lockscreen Calander+Reminders widget script

Post image
18 Upvotes

EDIT: Clarified instructions

UPDATE 12/27/2025: UPDATED to now include settings and lots of customization

Update 02/27/2026: UPDATED to fight iOS restrictions. Changed code relating to the picker, widget presentation, icloud dependency, and fixed the newly introduced ~24h crashing because of iOS 26

Update 05/19/2026: UPDATED to fix more Apple-induced problems :)

Why I made this: None of the current lockscreen calender event widgets fit my needs, my taste, or were too complicated/ gave me errors that I did not know how to solve. So, I, with the help of ChatGPT, created a script for this widget to solve my issues of forgetting things.

I think it turned out great. I’m sure it can be better optimized, but I find the functionality and clean aesthetic of this to work great for me.

People who are likely to miss important events, miss calendar events/reminders, or people who are busy will benefit from this script/widget. I initially made it for my girlfriend and I's usage, but I realized that others will benefit from it as well.

The widget is supposed to show 6 items for 7 days ahead, but it can be changed. Instructions on how to do that are after the directions below.

Directions to install:

  1. Ensure you download and run the Scriptable app.

  2. Paste the script code that is provided below into a new script in Scriptable

  3. (Optional) - rename script to something like "Lockscreen Calendar+Reminders"

  4. In Scriptable, tap the script to run it. You will see a button named "Reset Calendars". Tap it, read the message, and then tap continue.

  5. Select calendars that will host events that you will want on your Lockscreen in the widget.

  6. Once the calendars are selected, press "done." The Script will show a loading sign. Wait a few moments and then restart (FORCE CLOSE) the Scriptable app.

  7. Once Scriptable is restarted, tap the Script and then when prompted to reset the calendars, press "No."

  8. A preview of the events that will display on your lockscreen will show here. If you have a lot of reminders, this is a good time to purge through them to ensure you only have reminders that you would like to have on your lockscreen

  9. Now that you know what will show on your Lockscreen, hold down (long press 1 finger) on your lockscreen until it shows a "Customize" button.

  10. Press that "Customize" button.

  11. Tap an open space in a rectangle where a widget should be, else remove some widgets or press the "add widgets" button to add the Scriptable widget.

  12. Add the Scriptable app widget. It will show as "Run script." Tap the rectangular widget that is located on the right.

  13. The Scriptable widget will populate on the lock screen as some text. Tap the gear "edit widget to select script"

  14. For the script, tap on "Choose"

  15. Choose the script that you pasted into the Scriptable app. If you chose a name for the script, choose that name. If not, choose the automatic name that was set when you created the script.

  16. leave all of the other settings the same. Close out and the widget should populate on your lock screen.

All done.

Note: If you have a different font than what is default in IOS , then there may be issues with rendering the list. I'd recommend changing the front size in the settings.

If you have any questions, I may be able to assist you. I may make updates to this, I may not. It depends on what I find necessary.

Script code (Updated 05/19/2026):

// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: magic;
// ===============================
// Lock Screen Widget: Calendar + Reminders (May 19 2026 update to fix more Apple induced problems)
// ===============================
// DEFAULTS
// ===============================
const DEFAULT_LIST_ITEMS = 6
const DEFAULT_FONT_SIZE = 10
const DEFAULT_DAYS_AHEAD = 7
const DEFAULT_SHOW_END_TIME = false
const SETTINGS_FILE = "calendarWidgetSettings.json"

// ===============================
// FILE SYSTEM
// ===============================
const fm = FileManager.local()
const settingsPath = fm.joinPath(fm.documentsDirectory(), SETTINGS_FILE)

// ===============================
// LOAD SETTINGS
// ===============================
let settings = loadSettings()
let shouldPreview = false

// ===============================
// SETTINGS MENU
// ===============================
if (config.runsInApp) {

  let menu = new Alert()
  menu.title = "Settings"

  menu.addAction("Preview List")
  menu.addAction("Reset Calendars")
  menu.addAction("Display Settings")
  menu.addCancelAction("Close")

  let choice = await menu.presentAlert()

  if (choice === -1) {
    Script.complete()
    return
  }

  // ===============================
  // PREVIEW
  // ===============================
  if (choice === 0) {
    shouldPreview = true
  }

  // ===============================
  // RESET CALENDARS
  // ===============================
  if (choice === 1) {

    settings.calendars = await pickCalendars()
    saveSettings(settings)

    Script.complete()
    return
  }

  // ===============================
  // DISPLAY SETTINGS
  // ===============================
  if (choice === 2) {

    let dmenu = new Alert()
    dmenu.title = "Display Settings"

    dmenu.addAction("Change Tomorrow Text")
    dmenu.addAction("List & Font Settings")
    dmenu.addAction("Days Ahead")
    dmenu.addAction("Show End Time")
    dmenu.addCancelAction("Cancel")

    let dChoice = await dmenu.presentAlert()

    if (dChoice === -1) {
      Script.complete()
      return
    }

    // Tomorrow Label
    if (dChoice === 0) {
      let saved = await promptTomorrowLabel(settings)

      if (saved) {
        saveSettings(settings)
        shouldPreview = true
      }
    }

    // List + Font
    if (dChoice === 1) {
      let saved = await promptListFontSettings(settings)

      if (saved) {
        saveSettings(settings)
        shouldPreview = true
      }
    }

    // Days Ahead
    if (dChoice === 2) {
      let saved = await promptDaysAhead(settings)

      if (saved) {
        saveSettings(settings)
        shouldPreview = true
      }
    }

    // Show End Time
    if (dChoice === 3) {

      let a = new Alert()
      a.title = "Show End Time For Timed Events?"
      a.message =
        "All-day events will not be affected."

      a.addAction("Yes")
      a.addAction("No")
      a.addCancelAction("Cancel")

      let r = await a.presentAlert()

      if (r !== -1) {
        settings.showEndTime = (r === 0)
        saveSettings(settings)
        shouldPreview = true
      }
    }
  }
}

// ===============================
// STOP IF NOT WIDGET + NO PREVIEW
// ===============================
if (
  !config.runsInWidget &&
  !config.runsInAccessoryWidget &&
  !shouldPreview
) {
  Script.complete()
  return
}

// ===============================
// ENSURE CALENDARS
// ===============================
if (!settings.calendars.length && config.runsInApp) {

  settings.calendars = await pickCalendars()
  saveSettings(settings)
}

// ===============================
// DISPLAY VALUES
// ===============================
const MAX_ITEMS = settings.listItems ?? DEFAULT_LIST_ITEMS

const FONT_SIZE = settings.linkFontToList
  ? (MAX_ITEMS === 6 ? 10 : 11)
  : (settings.fontSize ?? DEFAULT_FONT_SIZE)

const DAYS_AHEAD = settings.daysAhead ?? DEFAULT_DAYS_AHEAD

const SHOW_END_TIME =
  settings.showEndTime ?? DEFAULT_SHOW_END_TIME

// ===============================
// DATE RANGE
// ===============================
const now = new Date()

const startOfToday = new Date(
  now.getFullYear(),
  now.getMonth(),
  now.getDate()
)

const tomorrow = new Date(startOfToday)
tomorrow.setDate(tomorrow.getDate() + 1)

const endDate = new Date(startOfToday)
endDate.setDate(endDate.getDate() + DAYS_AHEAD)

// ===============================
// CALENDAR EVENTS
// ===============================
let calendars = (await Calendar.forEvents())
  .filter(c => settings.calendars.includes(c.title))

let calendarEvents = []

if (settings.calendars.length) {

  calendarEvents = (
    await CalendarEvent.between(
      startOfToday,
      endDate,
      calendars
    )
  ).map(e => ({
    title: e.title,
    date: e.startDate,
    endDate: e.endDate,
    isAllDay: e.isAllDay,
    type: "event"
  }))
}

// ===============================
// REMINDERS
// ===============================
let reminders = await Reminder.allIncomplete()

let undated = []
let dated = []

for (let r of reminders) {

  if (!r.dueDate) {

    undated.push({
      title: r.title,
      type: "undated"
    })

  } else if (
    r.dueDate >= startOfToday &&
    r.dueDate <= endDate
  ) {

    dated.push({
      title: r.title,
      date: r.dueDate,
      isAllDay: !r.dueDateIncludesTime,
      type: "reminder"
    })
  }
}

// ===============================
// MERGE & SORT
// ===============================
let datedItems = [
  ...calendarEvents,
  ...dated
].sort((a, b) => a.date - b.date)

let items = [
  ...undated,
  ...datedItems
].slice(0, MAX_ITEMS)

// ===============================
// BUILD WIDGET
// ===============================
let widget = new ListWidget()
widget.setPadding(6, 6, 6, 6)

if (!settings.calendars.length) {

  let t = widget.addText("No calendars selected")

  t.font = Font.systemFont(FONT_SIZE)
  t.textColor = Color.gray()

} else {

  for (let item of items) {

    // ===============================
    // UNDATED REMINDERS
    // ===============================
    if (item.type === "undated") {

      let t = widget.addText(item.title)

      t.font = Font.systemFont(FONT_SIZE)
      t.textColor = Color.white()
      t.lineLimit = 1

      continue
    }

    let isToday = isSameDay(item.date, startOfToday)
    let isTomorrow = isSameDay(item.date, tomorrow)

    let color =
      isToday ? Color.white() : Color.gray()

    let row = widget.addStack()
    row.spacing = 6

    let label =
      isToday
        ? "Today"
        : isTomorrow
          ? getTomorrowLabel(settings, item.date)
          : formatDate(item.date)

    let d = row.addText(label)

    d.font = Font.systemFont(FONT_SIZE)
    d.textColor = color

    // ===============================
    // TIME
    // ===============================
    if (!item.isAllDay) {

      let timeString = formatTime(item.date)

      if (SHOW_END_TIME && item.endDate) {
        timeString +=
          "–" + formatTime(item.endDate)
      }

      let t = row.addText(" " + timeString)

      t.font = Font.systemFont(FONT_SIZE)
      t.textColor = color
    }

    // ===============================
    // TITLE
    // ===============================
    let title = row.addText(" " + item.title)

    title.font = Font.systemFont(FONT_SIZE)
    title.textColor = color
    title.lineLimit = 1
  }
}

// ===============================
// DISPLAY
// ===============================
if (
  config.runsInWidget ||
  config.runsInAccessoryWidget
) {
  Script.setWidget(widget)
} else {
  await widget.presentSmall()
}

Script.complete()

// ===============================
// SETTINGS FUNCTIONS
// ===============================
function defaultSettings() {

  return {
    calendars: [],
    tomorrowMode: "tomorrow",
    customTomorrowText: "",
    listItems: DEFAULT_LIST_ITEMS,
    linkFontToList: true,
    fontSize: DEFAULT_FONT_SIZE,
    daysAhead: DEFAULT_DAYS_AHEAD,
    showEndTime: DEFAULT_SHOW_END_TIME
  }
}

function loadSettings() {

  if (!fm.fileExists(settingsPath)) {
    return defaultSettings()
  }

  try {

    return Object.assign(
      defaultSettings(),
      JSON.parse(fm.readString(settingsPath))
    )

  } catch {

    return defaultSettings()
  }
}

function saveSettings(s) {
  fm.writeString(
    settingsPath,
    JSON.stringify(s)
  )
}

// ===============================
// CALENDAR PICKER
// ===============================
async function pickCalendars() {

  if (!config.runsInApp) {
    return settings.calendars ?? []
  }

  let picked = await Calendar.presentPicker(true)

  return picked.map(c => c.title)
}

// ===============================
// DISPLAY SETTINGS PROMPTS
// ===============================
async function promptDaysAhead(s) {

  let a = new Alert()
  a.title = "Days Ahead"

  a.addAction("Default (7 days)")
  a.addAction("Custom")
  a.addCancelAction("Cancel")

  let r = await a.presentAlert()

  if (r === -1) return false

  if (r === 0) {
    s.daysAhead = DEFAULT_DAYS_AHEAD
    return true
  }

  let i = new Alert()
  i.title = "Custom Days Ahead"

  i.addTextField(
    "Number of days",
    String(s.daysAhead)
  )

  i.addAction("Save")
  i.addCancelAction("Cancel")

  if ((await i.presentAlert()) === 0) {

    let val = parseInt(i.textFieldValue(0))

    if (!isNaN(val) && val > 0) {
      s.daysAhead = val
      return true
    }
  }

  return false
}

async function promptTomorrowLabel(s) {

  let a = new Alert()
  a.title = "Tomorrow Label"

  a.addAction("Display As Date")
  a.addAction("Display As \"Tomorrow\"")
  a.addAction("Custom Text")
  a.addCancelAction("Cancel")

  let r = await a.presentAlert()

  if (r === -1) return false

  if (r === 0) {
    s.tomorrowMode = "date"
    return true
  }

  if (r === 1) {
    s.tomorrowMode = "tomorrow"
    return true
  }

  let i = new Alert()
  i.title = "Custom Tomorrow Text"

  i.addTextField(
    "Text",
    s.customTomorrowText ?? ""
  )

  i.addAction("Save")
  i.addCancelAction("Cancel")

  if ((await i.presentAlert()) === 0) {

    s.tomorrowMode = "custom"
    s.customTomorrowText =
      i.textFieldValue(0)

    return true
  }

  return false
}

async function promptListFontSettings(s) {

  let a = new Alert()
  a.title = "List & Font Settings"

  a.addAction("Reset to Default")
  a.addAction("Custom")
  a.addCancelAction("Cancel")

  let r = await a.presentAlert()

  if (r === -1) return false

  if (r === 0) {

    s.linkFontToList = true
    s.listItems = DEFAULT_LIST_ITEMS
    s.fontSize = DEFAULT_FONT_SIZE

    return true
  }

  s.linkFontToList = false

  let i = new Alert()

  i.title = "Custom Values"
  i.message =
    "Top: List Items\nBottom: Font Size"

  i.addTextField(
    "List Items",
    String(s.listItems)
  )

  i.addTextField(
    "Font Size",
    String(s.fontSize)
  )

  i.addAction("Save")
  i.addCancelAction("Cancel")

  if ((await i.presentAlert()) === 0) {

    s.listItems = Math.max(
      1,
      parseInt(i.textFieldValue(0))
    )

    s.fontSize = Math.max(
      8,
      parseInt(i.textFieldValue(1))
    )

    return true
  }

  return false
}

// ===============================
// UTILITIES
// ===============================
function isSameDay(a, b) {

  return (
    a.getFullYear() === b.getFullYear() &&
    a.getMonth() === b.getMonth() &&
    a.getDate() === b.getDate()
  )
}

function getTomorrowLabel(s, d) {

  if (s.tomorrowMode === "date") {
    return formatDate(d)
  }

  if (
    s.tomorrowMode === "custom" &&
    s.customTomorrowText.trim()
  ) {
    return s.customTomorrowText.trim()
  }

  return "Tomorrow"
}

function formatDate(d) {

  return `${d.getMonth() + 1}/${d.getDate()}`
}

function formatTime(d) {

  let h = d.getHours()
  let m = d.getMinutes()

  let am = h >= 12 ? "PM" : "AM"

  h = h % 12 || 12

  return m === 0
    ? `${h}${am}`
    : `${h}:${m
        .toString()
        .padStart(2, "0")}${am}`
}

Credit: u/mvan231 and rudotriton for the calendar selector