Hi guys! Automation noob but have a few Shortcuts and want to learn more. As a freelancer I want to automate generating an invoice number based on adding an increment of 1 to whatever the previous invoice number was (simple really). I can then use this number to generate tasks and waiting-for actions with the correct invoice reference in, as well as possibly adding it as a line to a spreadsheet, and maybe even in generating the invoice itself (we’ll see). What’s the best way of referencing and updating the last-used invoice number in Shortcuts? Dictionary or some other scripting? Data jar? Help me, Automators! You’re my only hope.
Data Jar would be easiest. You just read and write a variable for your invoice number. Toolbox Pro also allows for simple access too should you have that. Even without both, you could still write to and read content from a file that would effectively do the same thing. You just have to manage it a bit more yourself.
If you only have a single number a dictionary is going to be overkill as one item of data does not benefit from the structure provided by a dictionary. But f you might have other items of data later, then it might become more useful at that point, but you certainly would not need to start with that.
So I should create a file to log and update the used invoice numbers for Shortcuts to reference? I have Toolbox Pro. What actions should I look for in Shortcuts to help me do this?
It’s probably just as quick to show you a working example.
Thanks so much, I think you’ve pretty much helped me crack this, and a great introduction to using a Global Variable in Toolbox Pro!