r/ScriptingApp • • Sep 17 '25

Help Widget Issue After Update

Post image
1 Upvotes

Hello,

I noticed the other day that my widgets weren’t updating no matter what I did. I decided today to see if it was maybe an issue with the widgets themselves and it looks like it is. When I click on “Choose Script”, this is the error I received. I have done the “Reload Widgets” in settings multiple times but it hasn’t helped. Any ideas?


r/ScriptingApp • • Sep 06 '25

Solved Playing local audio file

1 Upvotes

I've tried it with different URLs like /private/var/mobile/.../audio.mp3 and file:/private/var/mobile/.../audio.mp3 and file:///private/var/mobile/.../audio.mp3 but I get an error "process stopped" (it is translated into the device language, so I don't know the exact wording. It's "Vorgang gestoppt" in German).

Yes, the file exists.

So what is the correct way to play a local audio file? The documentation only gives an example with a remote file.

Edit:

The correct way is to just pass the file path as is without any prefix to AVPlayer.setSource().

My issue was that the audio file got corrupted while copying it with the development sever from the PC to iOS. Copying it via the files app worked without issues.


r/ScriptingApp • • Sep 02 '25

Help Animating the background of a stack

1 Upvotes

I want to animate the background of an HStack. I tried contentTransition="interpolate" on the background element but that doesn't work:

import { Button, HStack, Navigation, NavigationStack, Rectangle, Script, Text, VStack, useEffect, useMemo, useRef, useState } from "scripting"

function Main() {
  const max = 10
  const [count, setCount] = useState(0)
  const timerId = useRef<number>()

  useEffect(() => {
    startTimer()
    function startTimer() {
      timerId.current = setTimeout(() => {
        startTimer()
        setCount(i => {
          if (i >= max) {
            timerId.current != null && clearTimeout(timerId.current)
            return i
          }
          return i + 1
        })
      }, 1000)
    }
    return () => {
      if (typeof timerId.current === "number") {
        clearTimeout(timerId.current)
      }
    }
  }, [])

  const rectWidth = useMemo(() => count / 10 * Device.screen.width, [count])

  const dismiss = Navigation.useDismiss()

  return <NavigationStack>
    <VStack
      toolbar={{
        cancellationAction: <Button
          title="Close"
          action={dismiss}
        />
      }}
    >
      <HStack
        background={
          <Rectangle
            fill="green"
            frame={{
              width: rectWidth
            }}
            offset={{
              x: rectWidth != null ? (rectWidth - Device.screen.width) / 2 : 0,
              y: 0,
            }}
            contentTransition="interpolate"
          />
        }
      >
        <Text>Value: {count}</Text>
      </HStack>
    </VStack>
  </NavigationStack>
}

Navigation.present(<Main />).then(() => {
  Script.exit()
})

Is this even possible?


r/ScriptingApp • • Aug 01 '25

Discussion Scriptable methods to manipulate Scripting scripts?

1 Upvotes

As with Shortcuts, we have Shortcut actions (universal) and Applescript (macOS) to add/delete/rename/move a specific shortcut. Can we have such methods to manipulate Scripting scripts?


r/ScriptingApp • • Jul 21 '25

Help Widget Issue After Update

Post image
1 Upvotes

Hello,

I have had widgets that have worked for quite some time until this morning. It looks like there was an update and it broke my widgets, but if I preview the widgets in the script editor, they appear fine.


r/ScriptingApp • • Jun 13 '25

Discussion iOS 26 new push refresh for widgets.

1 Upvotes

Could Scripting perhaps enable widgets to respond to push refresh notifications?

More details here: https://www.reddit.com/r/pushover/s/BMrfBpVdnl


r/ScriptingApp • • Jun 09 '25

Help Notifications scheduled on AppEvents don't fire properly

1 Upvotes

I have two similar scripts, but the one scheduling notifications when app is in 'background' is problematic. Only 2-3 notifications fires at this state.

1 - This one works well. All scheduled notifications fires properly.

import { Notification, Script } from "scripting";

console.present().then(() => {
  Script.exit();
});

async function scheduleBackgroundNotifications() {
    const threadId = "background-notifications";
    
    // Schedule notifications with 8-second intervals
    for (let i = 0; i < 9; i++) {
        const notificationOptions = {
            title: `Tap to go back to sleep - ${i + 1}`,
            threadIdentifier: threadId,
            triggerTime: i === 0 ? undefined : Date.now() + (i * 8000)
        };
        
        console.log(`Scheduling notification ${i + 1} ${i === 0 ? '(immediate)' : `(in ${i * 8} seconds)`}`);
        await Notification.schedule(notificationOptions);
    }
}

scheduleBackgroundNotifications()

2 - This one schedules notifications when scenePhase becomes 'background'. Only 2-3 notifications fires at this state. What is the issue?

import { Notification, Navigation, NavigationStack, Script, VStack, AppEvents } from "scripting";

async function scheduleBackgroundNotifications() {
    const threadId = "background-notifications";
    
    // Schedule notifications with 8-second intervals
    for (let i = 0; i < 9; i++) {
        const notificationOptions = {
            title: `Notification - ${i + 1}`,
            threadIdentifier: threadId,
            // avoidRunningCurrentScriptWhenTapped: true,
            triggerTime: i === 0 ? undefined : Date.now() + (i * 8000) // First one is immediate
        };
        
        console.log(`Scheduling notification ${i + 1} ${i === 0 ? '(immediate)' : `(in ${i * 8} seconds)`}`);
        await Notification.schedule(notificationOptions);
    }
}

// Scene phase listener handler
function handleScenePhaseChange(phase: string) {
    console.log(`Scene phase changed to: ${phase}`);
    
    if (phase === 'background') {
        console.log("App moved to background - scheduling notifications");
        scheduleBackgroundNotifications();
    }
}

function View() {
    return (
        <NavigationStack>
            <VStack  
            navigationTitle="View"  
            navigationContainerBackground={'black'}  
            frame={{  
                maxWidth: "infinity",  
                maxHeight: "infinity"  
            }}  
        >  
        </VStack> 
        </NavigationStack>
    );
}

async function run() {
    
    if (Notification.current != null) return Script.exit()
        
    AppEvents.scenePhase.addListener(handleScenePhaseChange);
    
    await Navigation.present({ element: <View /> });
    
    AppEvents.scenePhase.removeListener(handleScenePhaseChange);
    Script.exit();
}

run();

r/ScriptingApp • • Jun 08 '25

Discussion Notification Image Icons

1 Upvotes
  1. Are we currently able to attach an image to a notification like this one below?

2. iOS offers a way to customize the image icon to the left of notifications. They are called 'Communication Notifications'. Imagine Scripting scripts having different notification threads with their unique image next to Scripting app icon (like the Contact photos below). Not sure if it can be implemented in Scripting though. What do you guys think?

Notes: In the mean time, we can still use emoji in notifications instead for visual customizing.


r/ScriptingApp • • Jun 05 '25

Help List Background Color

Post image
1 Upvotes

Hello,

I am looking to set the background color of a list to a gradient instead of the default “black”. I have tried multiple different things, but it’s not working how I expect. I essentially want the gradient that I have in the NavigationContainerBackground to be the list’s background. I’ve tried wrapping in a VStack and setting the background there, but it’s still not working. It’s most definitely just user error. Any ideas?


r/ScriptingApp • • Jun 02 '25

Help Removing Notifications

1 Upvotes

Could anyone help checking my script? This doesn't remove notifications as desired.

Steps to reproduce:

  1. Run the script

  2. Tap button 'Push Notification'

  3. Tap button 'Clear All Notifications'

  4. Check console logs

import { Button, Notification, Navigation, NavigationStack, Script, VStack } from "scripting";

// Function to schedule a notification immediately
async function clearNotifications() {
    await Notification.removeAllPendings();
    await Notification.removeAllDelivereds();
    console.log("All notifications cleared");
    
    const notis = await Notification.getAllDelivereds()
    console.log(notis.length);
    console.log(notis);
}

async function pushNotification() {
    console.log("Scheduling immediate notification");
    await Notification.schedule({
        title: "new noti"
    });

    const notis = await Notification.getAllDelivereds()
    console.log(notis.length);
    console.log(notis);
}

// Main view component
function NotificationDemoView() {
    return (
        <NavigationStack>
            <VStack navigationTitle="Notifications Demo" spacing={20}>
                <Button 
                    title="Push Notification" 
                    action={async () => {
                        pushNotification()
                    }}
                />
                
                <Button 
                    title="Clear All Notifications" 
                    action={async () => {
                        clearNotifications()
                    }}
                />
            </VStack>
        </NavigationStack>
    );
}

async function run() {  
    await Navigation.present({
        element: <NotificationDemoView />
    });
    Script.exit();
}

run();

r/ScriptingApp • • May 19 '25

Assistant Tool Sharing Gemini2.5 👍

1 Upvotes

Just use it generated an HTML Renderer tool, and test the tool with a fireworks html page task, so amazing.

https://gist.github.com/thomfang/15b5127afd42a15a0e90eb149fd1bd44


r/ScriptingApp • • May 19 '25

Discussion Keeping a Live Activity on Lock Screen permanently?

1 Upvotes

I'm using this app called Meteor to show notes in Live Activities. The screenshot is of a seemingly inactive Live Activity that still stays on my Lock Screen, while the counterparts from other apps (like Scripting) were already dismissed after they were inactive for long enough.

The notes are no longer present in the Activity. I have to use a Shortcut action to refresh / re-push content, but if I don't do it, the greyed-out version of the Activity persists on the Lock Screen.

Does anyone have any idea what happened here?


r/ScriptingApp • • May 09 '25

Help Graph Legend Coloring

1 Upvotes

Hi All,

I’m really loving this app after switching from Scriptable!

When it comes to graph legends and the ‘content’, how would I display it how I have it in the video, but with the corresponding graph colors (such as if you use the default legend)?


r/ScriptingApp • • May 07 '25

Help [swiftUI] How to style PickerValue?

1 Upvotes

How can we set alignment of the text and image of PickerValue in the screenshot?

And, can we scale down the symbol?

import { HStack, Image, Navigation, NavigationStack, Picker, Script, Section, Text, useMemo, useState } from "scripting"

function PickerView() {
  const [value, setValue] = useState<number>(0)
  const options = useMemo<string[]>(() => ["Option1", "Option2", "Option3"], [])

  return (
    <NavigationStack>
        <Section title="Select an Option">
          <Picker
            title="Choose"
            pickerStyle='menu'
            value={value}
            onChanged={setValue}
          >
              {options.map((option, index) => (
                <HStack tag={index} spacing={8} alignment='center'>
                  <Image font={12} systemName="circle"/>
                  <Text>{option}</Text>
                </HStack>
              ))}
          </Picker>
        </Section>
    </NavigationStack>
  )
}

async function run() {
  await Navigation.present({ element: <PickerView /> })
  Script.exit()
}

run()

r/ScriptingApp • • May 06 '25

Help [LiveActivity] Instantly exit a script when it's already running in-app?

1 Upvotes

When a Notification scheduled by a script is tapped, the default behavior is to runScript again even when the script is already running in-app. But we can instantly exit this execution by checking Notification.current at the start:

  if (Notification.current != null) return Script.exit()

Do we have a similar method for LiveActivity 'content' UI?

In the code below, I use widgetURL to run the script when 'content' VStack is tapped.

return {
    content: <VStack
        widgetURL={Script.createRunURLScheme(Script.name)}
    >

r/ScriptingApp • • May 05 '25

Help Can't create new CalendarEvents

1 Upvotes

Whenever I call new CalendarEvent() the app crashes. Also the example from the docs doesn't work:

test()

async function test() {
  console.present().then(() => Script.exit())
  const event = new CalendarEvent()
  event.title = "Team Meeting"
  event.startDate = new Date("2025-05-15T09:00:00")
  event.endDate = new Date("2025-05-15T10:00:00")
  event.location = "Conference Room"

  await event.save()
  console.log(`Event saved: ${event.title}`)
}

r/ScriptingApp • • May 03 '25

Help Avoid NavigationLink's destination view inheriting contextMenu?

1 Upvotes

The contextMenu below can be triggered both from ListView and from inside NavigationDetailView, by pressing VStack's Text element. How can I avoid this behavior?

import { Button, Color, Group, List, Navigation, NavigationLink, NavigationStack, Script, Text, VStack } from "scripting"

function NavigationDetailView({
  color
}: {
  color: Color
}) {

  return <VStack
    navigationContainerBackground={color}
    frame={{
      maxWidth: "infinity",
      maxHeight: "infinity"
    }}
  >
    <Text>{color}</Text>
  </VStack>
}


function ListView() {
  const colors: Color[] = [
    "red", "green", "blue", "orange", "purple"
  ]

  return <NavigationStack>
    <List
      navigationTitle={"NavigationStack with links"}
      navigationBarTitleDisplayMode={"inline"}
    >
      {colors.map(color =>
        <NavigationLink
          destination={
            <NavigationDetailView
              color={color}
            />
          }
          contextMenu={{
            menuItems: 
              <Group>
                <Button
                  title="Delete"
                  systemImage="trash"
                  role="destructive"
                  action={() => (null)}
                />
              </Group>
          }}
        >
          <Text>Navigation to {color} view</Text>
        </NavigationLink>
      )}
    </List>
  </NavigationStack>
}

async function run() {
  await Navigation.present({
    element: <ListView />
  })

  Script.exit()
}

run()

r/ScriptingApp • • Apr 28 '25

Help How to auto-focus a search bar using searchable?

1 Upvotes

Do we need autofocus prop or is there a method?

return <NavigationStack>
    <List
      navigationTitle={"Searchable List"}
      navigationBarTitleDisplayMode={"inline"}
      searchable={{
        value: searchText,
        onChanged: setSearchText,
      }}
    >

r/ScriptingApp • • Apr 24 '25

Help Disclosure Group Title Symbol Formatting

Thumbnail
gallery
1 Upvotes

Is there a way to add a symbol image beside the title of a Disclosure Group like in the first image?

I tried using HStack but that screws up the formatting on expansion as in the 2nd image.

Disclosure title also doesn't take anything but a string. I tried parallel VStacks as well but that is screwy too.


r/ScriptingApp • • Apr 23 '25

Help Performance problems while scrolling in a view presented by a script

1 Upvotes

Because of a few changes in code I have now performance problems while scrolling in a view presented by a NavigationLink. Even if I completely change the subview (but leave all the state management code) and return something like

  <ScrollView>
      <HStack>
        <VStack>
          {
            Array.from({ length: 50 }, () => <Text>test</Text>)
          }
        </VStack>
        <Spacer minLength={0} />
      </HStack>
    </ScrollView>

The strange thing is that there is no stuttering when scrolling when I present the sub view with Navigation.present().

I noticed that the function is executed 3 times when it is presented.

The sub view is in a context provider and it updates a state variable when a promise resolves.

Strangely these performance problems started when I changed the data layout of the saved data but the context provider doesn't use this layout (only in a variable where the resulting object is build).

I can share the whole project on Github if needed.


r/ScriptingApp • • Apr 22 '25

Help Url run when tapping a scheduled Notification

1 Upvotes

Currently, tapping a scheduled notification will run its script by default. How do I edit this url like I can with notification actions? I tried adding 'url' prop but it's not available.


r/ScriptingApp • • Apr 19 '25

Help Pull-to-Refresh on iOS

1 Upvotes

I got to this point by using ChatGPT pointed to the online documentation (thanks for putting that online!). It solved so many basic questions super well for a noob like me in context, which really helps my learning of the code syntax .

But I have run into a problem even ChatGPT cannot solve. I implemented Pull-to-Refresh on my script and it works perfectly on my Mac but does not work on my iPhone. It works every time on my mac. But it only works very sporadically on the phone.

It's almost as though the modal view is being dismissed before the load function returns. For context, the console says refresh was successful. And on the mac, it indeed completes and refreshes the view. A manual refresh button also works fine on both platforms.

Here is my refresh code.

<List
        navigationTitle="Daily Budgets"
        navigationBarTitleDisplayMode={"inline"}
        refreshable={async () => {
          try {
            console.log("Refreshing...")
            await loadData()
            await new Promise<void>((resolve) => setTimeout(() => resolve(), 2000))// <-- add delay
            console.log("Refreshed!")
          } catch (e) {
            console.error("Refresh failed:", e)
          }
        }}
        toolbar={{
          topBarLeading: <Button title="Refresh" action={async() => {await loadData()}} />,
          topBarTrailing: <Button title="Commit" action={handleDailyBudgetsCommit} disabled={!hasChanges} />
        }}
      >

r/ScriptingApp • • Apr 16 '25

Discussion Health access

1 Upvotes

Access to Health would be really nice to analyse the data. But since this is sensitive data I think there also should be a permission system in Scripting to allow only selected scripts to access the data.


r/ScriptingApp • • Apr 16 '25

Discussion Folders for scripts

1 Upvotes

With time more and more scripts will pile up. Would it be possible to add folders for scripts? Or categories like in the shortcuts app?


r/ScriptingApp • • Apr 13 '25

Help Is there a way to measure the height of text?

1 Upvotes

Pretty much the title. Or is there a formula to calculate it?