Today's task in Captain's Log was to get the "run command" action working. Mark Anderson, author of A Tinderbox Reference, recommends getting the command line input working in the terminal first.

I have an app called Midwatch Entry in the Applications folder, which I know works if I launch it. It finds the correct Midwatch entry in the log, and enters the next 3 days' events in the $Text of the note.

I asked ChatGPT what terminal command I would use to launch it, and it came back with, open -a "Midwatch Entry".

Heeding Mr. Anderson, I opened Terminal and entered that text verbatim (after deleting the previous Midwatch entry and allowing a new one to be created by today's container) into the command line.

Voila! The desired result.

So on to the log...

To make a long, boring story short. I renamed the app MidwatchEntry, deleting the space, and then the action code runCommand("open -a MidwatchEntry"); worked like a champ.

Quotation vexation ensues with that space in there. Command line requires the quotes because of the space. Tinderbox requires quotes in the action code. Tried "escaping" quotes, but wasn't holding my tongue right or something.

The "Delete the friggin' space!" light illuminated, and there was much rejoicing.

I'm not sure I learned much, but I have some confidence that if I keep screwing around with this stuff I might learn something through osmosis.

I have to clean up after myself and add a line to disable the edict after it runs because it only has to run once. I don't know if there's an advantage to using a $Rule over an $Edict, they mostly do the same things, just at different frequencies. Edicts are much more infrequent. But I don't want it updating itself once it's done its thing.

Pressing on...

✍️ Reply by email

Originally posted at Nice Marmot 13:43 Saturday, 16 March 2024