Iâm using this in a little utility Iâve written for others. Theyâll have the choice of either downloading the utility as an .app with MT v1.0.6 in the bundle, or theyâll be able to download my source script and follow directions to install MT themselves locally from the macosxautomation site.
In the latter case, will my source script work without changes in the future if they download a later version of MT (e.g. a hypothetical v1.0.7)
My scriptâs import statement is
use script "Myriad Tables Lib" version "1.0.6"
Does the MT source code allow the stated version or higher, or is it strict to the actual version stated?
Itâll show the backup of the source disk without the shell script, which it gets from CCCâs Task History, but it wonât show when any of your connected disks were last backed up until theyâve been backed up with the shell script.
BTW, the postRun.sh script is now included in the bundleâs Resources/Scripts folder in v1.1 (and so is the Myriad Tables Lib, which I forgot to add in v1 and didnât notice as it was running from my own installed version. ).
Also the applet isnât saved as ârun onlyâ so all can marvel at my bad coding practices; resist the temptation to âimproveâ it though, as thatâll break the codesigning.
This is a bit more friendly to non-English speakers:
set s to do shell script "tmutil latestbackup"
set s_String to NSString's stringWithString:s
set theIndex to location of (s_String's rangeOfString:"/" options:(current application's NSBackwardsSearch))
set timeString to s_String's substringFromIndex:(theIndex + 1)
set dateFormatter to current application's NSDateFormatter's new()
dateFormatter's setDateFormat:("yyyy-MM-dd-HHmmss")
set theDate to dateFormatter's dateFromString:timeString
dateFormatter's setDateStyle:(current application's NSDateFormatterLongStyle)
dateFormatter's setTimeStyle:(current application's NSDateFormatterShortStyle)
set timeString to (dateFormatter's stringFromDate:theDate) as text
Thanks, Iâll try to add such niceties in v1.3. Right now Iâm having nightmares with codesigning. The earlier versions passed on the latest beta of 10.12, but now I canât get either SD or SE to codesign the bundle correctly. One and the same signed bundle gives me different results depending on what I try to download it onto:
10.10.5 & 10.11.6 - pass
10.12.1 release - pass, but flagged as âweakâ in RB App Checker Lite
10.12.2 16C63a - fail
Totally flumoxed. I donât see that Iâve done anything different from the version this morning to the one Iâm trying to do now.
EDIT: solved by rebuilding the whole project on Sierra beta and codesigning there. Not fun!
The problem was that signing the app in 10.11.6 would pass Gatekeeper on 10.11.6 but not 10.12.2. (by which I mean downloading it to my own machine externally from the aws host threw the âunidentified developerâ dialog in the latter but not the former).
For reasons I havenât yet determined, that didnât occur with v1 or v1.1 built only a few hours earlier on the same machine and install.
I encounted a few other problems at the same time with SD and autosave and with copying resources into the bundle (is there any way to stop SD autosaving?); my impression was that the corruption was something to do with the order in which SD was autosaving and signing the current state of the app, but tbh, I was more concerned with fixing the problem ASAP than analysing the cause. Iâll be able to take a more leisurely approach when I do the 1.3 update (forewarned, forearmed anâ all that).
According to RB App Checker Lite, the problem was the Info.plist was not signed or had been altered after signing. Thatâs what led me to think it was something to do with the order of the save/signing process.
It occurred to me earlier today that I should turn code signing off until the final build / save. As SD code signs on each and every compile, run and save, perhaps the whole signing signature had become corrupted in some way.
Anyways, if it occurs again Iâll take the trouble to document some reproducible steps and we can take it from there.
I strongly recommend keeping all but the simplest of script libraries out of bundles during development, and adding them only when ready to export deployment versions. Thereâs a script in that article that can be adapted to make it a simple process.