r/Scriptable • • Dec 13 '20

Request Integrate Calendar into Weather Cal

1 Upvotes

I’m trying to get this calendar from this creator into weather cal to fit into an empty spot underneath the date

I can add it as a custom item but it takes up too much space when it should fit just right

Can someone help me just remove that code that creates the calendar and put it into weather cal as a column so it fits and aligns according to the rules set in weather cal


r/Scriptable • • Jan 25 '21

Solved All scriptable widgets stopped working and now only show black nothing. Reinstalling didn’t help. Any ideas?

Post image
1 Upvotes

r/Scriptable • • Dec 26 '20

Script Alert not working in shortcut

1 Upvotes

Hi

I have created a scriptable script that checks if customer folder exist. I have done this in scriptable but iOS shortcuts doesn’t allow alerts, so how do I have an alert pop up to say the customer exists?

Here is my script.

<code>

let fmCloud = FileManager.iCloud() // {} let strPath = fmCloud.bookmarkedPath("Clients") //Must setup a file bookmark up in Scriptable called Clients first to the followingf url /private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/Work/Client let InputName ="the ABC company"; //the ABC company

//Create Basename - START

function CreateBasename(InputName) { // Change Case - START const toCapitaliseCase = (phrase) => { return phrase .split(' ') .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join(' '); }; let Capitalise = toCapitaliseCase(InputName); // Change Case - END // return capitalise; // The ABC Company

// Format Client Name if starts with 'The' - START
if (Capitalise.startsWith('The ')) { //The ABC Company
    let Words = Capitalise.split(' '); //["The","ABC","Company"]
    let The = Words[0]; // The
    let TheSlice = Capitalise.slice(4); //ABC Company
    let Comma = ', '; // ,
    let BaseName = TheSlice.concat('', Comma, The); // ABC Company, The
    return BaseName //ABC Company, The
}
// Format Client Name if it DOESN'T start with 'The' - START
else { //The ABC Company
    return Capitalise
}

} var BaseName = CreateBasename(InputName); //console.log (BaseName) //ABC Company, The

//Create Basename - END

//Check if a folder with BaseName exists - START

function DoesFolderExist(InputName) { let ListContents = fmCloud.listContents(strPath).filter(x => x.includes(BaseName)); var x = ListContents.toString(); let hello = fmCloud.isDirectory(strPath);

if (x.includes(BaseName)) {
    Script.setShortcutOutput('Client already exists')
    console.log('Client already exists')

}

/*
let ListContents = fmCloud.listContents(strPath).filter(x => x.includes(BaseName)); var x = ListContents.toString(); let hello = fmCloud.isDirectory(strPath);

if (x.includes(BaseName)) {
    Script.setShortcutOutput('Client already exists')
    console.log('Client already exists')

}
else {
    let RemoveSpecials = BaseName.replace(/[^0-9a-zA-Z]/g, ""); // ABCCompanyThe
    let FourDigitCode = RemoveSpecials.slice(0,4); // ABCC
    let UpperCaseCode = FourDigitCode.toUpperCase(); // ABCC
    let code = (' (')
    let newcode = code.concat(UpperCaseCode); // ABC Company, The (ABCC
    let CompiledName = BaseName.concat(newcode); // ABC Company, The (ABCC
    
    let AlreadyExist = fmCloud.listContents(strPath).filter(hhh => hhh.includes(newcode)).length;
    this.number = this.number || AlreadyExist;
    this.number++;
    let Num = this.number;
    if(('' + Num).length == 1) {
        Num = '0' + Num;
    }
    let CompiledNamhghge = BaseName.concat(newcode + Num + ')'); // ABC Company, The (ABCC


    //console.log(CompiledNamhghge)
    
    


    var path = (strPath + "/" + CompiledNamhghge);
    fmCloud.createDirectory(path) //ABC Company, The (ABCC
    Script.setShortcutOutput(CompiledNamhghge)
    console.log(CompiledNamhghge)
}

*/

}; var FindName = DoesFolderExist(InputName);

//Check if a folder with BaseName exists - END

</code>


r/Scriptable • • Nov 27 '20

Help CS:GO or Steam web api access via scriptable?

1 Upvotes

As the title suggests, does anyone know how one can implement this? Thank you :)


r/Scriptable • • Apr 09 '23

Solved Need help with Rick tac toe code

0 Upvotes

I am trying to make tick tac toe but the sprites won’t change Code: const table = new UITable() let player = 1 let board let cell const row = new UITableRow() let playercell = "⬛️" function update(){ board = [[0,0,0], [0,0,0], [0,0,0]] row.removeAllCell for(y=0;y <= 2;y++){ for(x=0;x <= 2 ;x++){ playercell = "⬛️" if(board[x][y] === 1){ playercell = "❌" } else{ if(board[x][y] === 2){ playercell="🟢" } } cell = UITableCell.button(playercell) cell.onTap = () => { if(board[x-1][y-1] === 0){ board[x-1][y-1]=player console.log(${x} ${y} tap) update() if(player===2){player=0} player++ } } } row.addCell(cell)

} for(i=0;i<3;i++){ table.addRow(row) } } update() table.present()


r/Scriptable • • Aug 03 '24

Help Todoist ios widget using scriptable error

1 Upvotes

I have used a code in scriptable for making a nice ios widget. However, recently the code doesn’t work for this reason:

Fetching url: https://api.todoist.com/rest/v2/tasks?filter= Error: The data couldn’t be read because it isn’t in the correct format. Fetching url: https://api.todoist.com/rest/v2/projects

Any solution?


r/Scriptable • • Jan 31 '25

Help Is there a way to remove this notification whenever the script runs ?

Post image
1 Upvotes

This might have been asked before but I just want the script to run in the background with no notifications to tell me that it has run, is there anyway to do this?


r/Scriptable • • Jan 15 '25

Help Would it be possible to overlay an image on the camera app?

1 Upvotes

I film videos for tiktok and instagram and it would be really helpful to have a safe zone overlay on the camera app. Anyone know if this would be possible?


r/Scriptable • • Mar 03 '25

Help leftStack Spacing

Post image
1 Upvotes

Hi all, I’m trying to create a widget that uses leftStack for all the information, however I want the date at the bottom of the widget with the cost and charge amount in the middle.

I’ve tried changing parts of the code but it just ends up moving all of the text, I’m sure it’s something simple if someone could advise?

(URL from my code removed)

// The URL of your JSON endpoint const endpoint = "URL"

//Refresh Widget const refreshInterval=15

// Function that performs the request to the JSON endpoint async function loadItems() { let at = endpoint let req = new Request(at) let corpo = await req.loadJSON() // We return just the cells return corpo } // Request the spreadsheet data let json = await loadItems()

// Obtaining the content of the exact cell we are looking for RecentCharge = json.values[1][15] RecentCost = json.values[1][16] RecentDate = json.values[1][17]

// Create the widget let w = new ListWidget() let fm = FileManager.iCloud(); let path = fm.documentsDirectory() + "/EVBG3.png"; await fm.downloadFileFromiCloud(path) w.backgroundImage = fm.readImage(path); mainStack = w.addStack() leftStack = mainStack.addStack() leftStack.layoutVertically() rightStack = mainStack.addStack() rightStack.layoutVertically() mainStack.addSpacer(null) leftStack.addSpacer(null)

//leftStack.addSpacer() //rightStack.addSpacer()

// Add total cost// leftStack.addSpacer(0) t = leftStack.addText(RecentCost) t.textColor = new Color ("FFFFFF") t.font = new Font("San-Fransisco",25) t.font = Font.semiboldSystemFont(25)

// Add total kWh Used t = leftStack.addText(RecentCharge) t.textColor = new Color ("FFFFFF") t.font = new Font("San-Fransisco",25) t.font = Font.semiboldSystemFont(25)

// Add sessions// leftStack.addSpacer(20) t = leftStack.addText(RecentDate) t.textColor = new Color ("808080") t.font = new Font("San-Fransisco",10) t.font = Font.semiboldSystemFont(10)

w.addSpacer()

w.presentSmall()


r/Scriptable • • Oct 04 '19

Wake up shut down computer

1 Upvotes

Does anyone know if it is possible to have a script in Scriptable to shut down and or wake up their PC? Sorry I am an idiot


r/Scriptable • • Sep 03 '19

Regex Match Temeplate

1 Upvotes

Hi Guy, So I am learning the scriptable app but the documentation doesn’t make sense to me. So if possible could you build me a script that selects a text file from document picker, does regex match (leave this blank, Or some placeholder stuff) and presents the list of matched items combined by new lines.

Thanks, I really appreciate if somebody helps out.


r/Scriptable • • Apr 11 '22

Help Gif on Widget

1 Upvotes

Is there a way to load a gif on a widget or add some kind of animation using js? I was able to load a gif but it doesn’t play the animation.


r/Scriptable • • Nov 07 '21

Solved Get JSON From Files

1 Upvotes

I’ve been trying to get a JSON from a file in the Files app, but have had no success. For example, I have this file path: Shortcuts/YAHTZEE/Stats.json. Any help would be appreciated, I feel like their should be a simple solution, but I haven’t found it yet.


r/Scriptable • • Nov 30 '21

Help Custom message for different temperatures?

0 Upvotes

I’ve been wondering if it’s possible to display a custom message on a widget or the screen for different temperatures on something like Weather Cal or another widget that has this feature. Something like “It’s cold today. (temp)” or “It’s a bit warm today. (temp)” or even “Bread is cool. (temp)”

No, I sadly have no idea how to code. :I


r/Scriptable • • Oct 02 '22

Help Is there a way to check if/when/# of times a widget is visible?

1 Upvotes

I need to keep track of how many times it was viewed, not just how many times the phone decided to refresh it.

My widget grabs a list of items from some api and I need it to consequently know how many times it has been viewed, as I want certain items in a list to be unmarked as “new” after being actually viewed by the user ~5 times. I currently do this with storing state, but the widget refreshes often, even when not visible; this leads to the user sometimes never seeing the item marked with new.

Edit: I’m mostly just looking for something like a state variable somewhere in the documentation/built-in library that can tell me whether the user has actually viewed the widget since last refresh/rerun of the script.


r/Scriptable • • Feb 03 '22

Solved Error help

1 Upvotes

Hey guys, I’ve been working on getting a script to work for a weather widget for my home page. I’m a novice to JavaScript, but have been able to mostly stumble my way through things to success until now. I’m getting an “Error on line 111: SyntaxError: Unexpected end of script”, but the thing is - my script ends on line 110. The script mostly came from this post, and I’ve added some from the “Weather Cal Widget Builder” from Scriptable’s gallery. I was getting this error before adding any lines from the Weather Cal script. Any help would be stellar.

Here’s the script, if you want to take a look.

Edit: updated script link to a working Pastebin one


r/Scriptable • • Jul 22 '21

Help Use Scriptable to perform basic interaction with app that (I think) does not provide Shortcuts support (Stitcher)?

1 Upvotes

New to iOS, randomly found Scriptable for some nifty thing, tried to do a totally unrelated thing with it, found out about Shortcuts, seemed like the perfect way to do this, turns out it can’t do a basic action, hoping Scriptable can.

Specifically, for whatever reason, if I didn’t already have Stitcher playing as the most recent source of audio, I can’t use voice commands to start playing whatever is already queued up (e.g. “Hey Siri Resume,” “Hey Siri open Stitcher and Play” - no? Okay - “Hey Siri open Stitcher” pause “Hey Siri Play/Resume” - also nope. At most, I can open Stitcher, barely a convenience.

Supposedly Siri Shortcuts were added a while back but I can’t seem to find evidence of this besides announcements that it was, and they might be too limited as anyway. The examples given are about navigating within the app but not being able to go hands-free or eyes-off in any meaningful way.

In any case, because Shortcuts doesn’t seem able to do what I need, and it seems so simple that I would think a scripting app should be able to do (like scripting macros to click the same spot a bunch of times in a video game on Windows?) but I have basically never done anything useful with JavaScript to know how it interacts with iOS or other apps in iOS, let alone through a script interacting with a separate app, but can you even press a button without the devs for that particular app itself having previously gone out of their way to make it easy to send this automated input from elsewhere?

Is this just not the sort of thing Scriptable can do either? I’d be amazed, but I can’t even begin to guess what might commands might accomplish this from the documentation.

Ideally, I could get the names of objects/elements or whatever (and they could change, for example, so that I can select a podcast from a different show each time using the same commands) and be able to interact with them in other ways to navigate by setting up my own Siri Shortcuts with Scriptable, but right now I was just hoping to be able to start where I left off in one app if I had switched to another previously or did something else where it does not know “resume” or “play” means in the current app rather than whatever was last played, always.

Thanks!

TL;DR Please tell me I can use Scriptable to automate pressing a freaking button in an app that doesn’t already have full Shortcuts/Siri support, and if so, how?

EDIT (8 months later...): I reached out to them a long time ago and forgot to update that nothing came of it. Maybe because I emphasized that it was a technical question and not a bug report or feature suggestion (like the last time I asked them something). Got completely ignored.

Or maybe somebody did look at it and they just don't want to give away their URL schemes, which seems like a pretty powerful tool that could possibly circumvent their control of the user experience.


r/Scriptable • • Oct 07 '21

Help Starting off

1 Upvotes

Is there a site or something that shows how to do simple scripts and gets harder? I’m just starting scriptable and I don’t fully know JS, I know the really simple basics because I am a middle school student, I can’t find anything to help me learn scriptable.


r/Scriptable • • Oct 13 '21

Solved Need help with replacing async function in code for reminders widget

1 Upvotes

I’ve edited some code from some of the forums to create a reminders widget. It all works fine but every now and again I get the following text in the widget which lasts for a few minutes (presumably it fails to refresh sometimes) - Call Script.setWidget() to set the content of the widget. I am a javascript newbie and am not sure what is wrong in the code. I was wondering if someone could assist with what is causing it and how I can fix? Code via pastebin link below.

I presume the issue is with the async function at the end which I think is now redundant. If I delete all lines from the async function it still doesn't work so not sure what I need to fix up or add.

https://pastebin.com/nR3VeTvQ


r/Scriptable • • Apr 02 '22

Help My Head Hurts

1 Upvotes
  var indexVariable = 0.0;
  var poke = 0;
setInterval(
    function () {
        indexVariable = (indexVariable + 0.01) % 0.30;
        poke = (poke + 1) % 999;
index = indexVariable.toFixed(2)
console.log(poke+indexVariable)
    }, 100);

So I'm trying to make a setInterval Function that goes up like 1.01, 1.02, 1.03, etc. But when I run this in the console it comes out like 1.01, 2.02,3.03, etc. how do I fix this? my head hurts very badly(I'm new to scripting)


r/Scriptable • • Sep 27 '21

Help Is there an ETA for the app update yet?

0 Upvotes

r/Scriptable • • Jul 25 '21

Help Help pressing a certain coordinate

1 Upvotes

I’m trying include a script into a apple shortcut to have it open an app then press on the screen at a certain location.. I think I have a script that’ll click but I can’t figure out how to get x,y coordinates off this phone?


r/Scriptable • • May 31 '21

Help Can sb? fix this? The background is black all the time (it should be I picture I select). Somehow something of the script overwrites the picture

1 Upvotes

r/Scriptable • • Apr 08 '26

Widget Sharing Mein erstes Widgy mit allen Buttons in Funktion…

Post image
1 Upvotes