A bit more precisely, it is the “bundle signature” or, a little less accurately, the “bundle ID” of an application that is defined in the info.plist of an application on macOS. E.g., in the info.plist for Tinderbox we see:
As long as a developer is consistent in the use of the code, then AppleScript “knows” what software it is being told to manipulate. This normally survives version releases and updates.
I imagine “Cere” means something to Eastgate. Just as “DNTP” means something to DEVONtechnologies as the ID for DEVONthink.
Thanks. That could save a little work updating scripts in the future if one always keeps just one version of the app on the Mac. But what if (as in my case) there is more than one version of the app in the Applications folder? I give older ones slightly different names, with “Tinderbox 9” (currently v. 9.6.0) being my latest.
I am interested in Quarto and found out about the Marked2 Streaming Preview here.
And I want to preview the R chunks included in a markdown. After some trial and error, I was able to get it to display in Marked2’s Streaming Preview, and I will share it with you.
The code below is a custom processor shell script for Marked2.
Please modify it to your environment.
#!/bin/bash
export PATH=/opt/homebrew/bin:/usr/local/bin:/Library/TeX/texbin/:$PATH
if [ -z "$MARKED_ORIGIN" ]; then
# for markdown file
cd $MARKED_ORIGIN
else
# for streaming preview with image files (relative path)
cd /your_project/path
fi
# write output to a temporary file
# You can change the name to a non-duplicate name.
cat - > tempforstreamingpreview.qmd
# Add packages you need for the R chunk
Rscript --default-packages=dplyr,knitr,kableExtra,stats,datasets -e "rendered_output <- rmarkdown::render('tempforstreamingpreview.qmd', output_format = 'html_document',quiet=TRUE, output_options=list(title='PREVIEW'))" -e "cat(readLines(rendered_output), sep = '\n')"
# remove temporary file
rm tempforstreamingpreview.qmd
The key point is to load the required PACKAGE in the Rscript command options.( --default-packages)
If the package is missing, it will not be displayed.
It took some time to recognise that the streaming preview window will receive the unprocessed text of the note(s) only. I played with the template and wondered why there is no change…