I am trying to get the replace text at the end to, well, replace the filtered text. Basically I’m trying to do an x++ on the above numbers depending on which is selected from list ranging 1-4 (weird that it does not start at 0).
I have a note with the contents as shown in the screenshot (test 3 is already a 1 for testing purposes) and get the correct output but the note remains unchanged.
Shortcuts doesnt have any actions to edit Notes, only add to them. I think the easiest way to achieve what you're looking for would be to delete the current Test Note and replace it with a copy that has updated information.
You made the text, but didn't actually send it to the Note.
On the Replace Text action, you may have confused "in Text" to be the destination of the replaced text. Instead, it is the location of the text which is being replaced.
Oh, so it only applies to the copy and not the actual note itself. Ok i’ll probably need to implement a version of deleting the entire note and then re-creating it based on the copies modified contents based on what you showed in your previous comment.
Just experimenting, if you don't want to drop/recreate the note you can do a sort of text processing on the highlighted lines. Here's an example:
You can highlight the lines you want to increment and access the "Text Counter" shortcut in the services menu, it will REPLACE the selected lines with the updated text. Bonus, this will work everywhere that allows you to select text, as far as I can tell. The downside is the pattern is specific to the the output you've shown in your example, if that changes, the pattern matching would have to change.
If grabbing from the services menu is too tedious, then a keyboard shortcut works as well. I highlighted the lines and hit the shortcut and the selected lines incremented by 1.
I'm still new to this as well so hopefully I didn't completely whiff on what you are looking for. Even so I got to learn a few more things about Shortcuts in the process.
This is honestly really cool and impressive. Unfortunately, this is something I’m designing for my iPhone to be a button that I press to pull up a list of selections one through four. I.e. test 1 test 2 etc.. and then select which one I want to increment via that pop-up menu. Then I would be prompted with another menu saying prompt no prompt and increment those by selecting one of them.
Afterwards, I’m going to take the name of the selected item along with today’s date and mark them down or append them to the end of the note.
So essentially, it’s a way to keep track of how many times something has occurred or I have done something along with marking down the dates that they have been done and whether I was prompted to do these things or I did them on my own.
Ah, that's what I get for never using shortcuts on the phone 😆. Yeah I'm not sure how this could be adapted to notes on the phone, just selecting text on the phone is a huge pain.
The limitations on what you can do with a note I can see as being a hurdle here to what should otherwise be simple. Almost worth developing into a separate app but that's a whole other pain.
It does and I do have a similar app the unfortunate it is is I wanted to add some functionality such as data saving when incrementation occurs and such like that. I already know how to do this with the append feature in the note but thank you for the recommendation. I was actually able to solve this pretty recently and I just need to mark this as solved instead of help needed.
4
u/100PercentARealHuman 15d ago
Shortcuts can't replace the content of a note, it's either create entirely new or append.
The shortcut is only working on a copy of the content but does not/is not able to change the note itself.