SD Notary Feature Request: Run Script on Completion

Have you considered adding the ability to have SD Notary run a script (AppleScript, bash, etc) upon completion? Also having a scriptable way to set the completion script would be useful.

For one Java project I have (and also another JXA project), I use SD Notary to notarize the finished app. SD Notary is opened via a script that is run at the end of my customized build process with the desired settings for the app, but I don’t have that script start the notarization process. I like to start the notarization process manually once I’m sure I’m happy with everything.

I could have a script busy-wait for a notarized app to be created to automatically zip it up and name the zip properly, but that feels very inefficient. That script would also need to be manually killed if I decide not to notarize for some reason. As it is now I just zip the app and rename it manually after notarization has successfully completed. It’s a very simple process, but it feels like it could pretty easily automated if SD Notary could start up an arbitrary script when it’s done. Also, I could imagine other user with other projects may have a more complex post-notarization process that they’d want to automate.

It feels like having SD Notary be able to start up a script once it has successfully finished its notarization process would compliment SD Notary purpose nicely and could be very useful for probably a lot of users different use cases.

What do you think about that? I understand if it’s outside of the scope of what you want for SD Notary, but I wanted to share the idea nonetheless.

Also, thank you so much for SD Notary! It has made notarizing non-Xcode projects a real breeze!

I guess I’m struggling to see why, when you manually start the notarization process, you can’t instead manually run a script that starts the process, and then follows up with whatever post-process you require.

Yeah, that’s fair. I can setup my script to prompt whether I want to notarize rather than just launching SD Notary for me to manually start it. Then the script could automatically start the notarization if I choose to do so in the prompt and then wait for notarization to finish for post-processing.

At first thought, it just felt cleaner to have SD Notary have a way to execute a script when it knows it has successfully finished rather than another script trying to assert that is has successfully finished (and having to detect failure states so that the script doesn’t infinitely wait for success when the notarization has failed). Also if anything with SD Notary folder names or log entries changed in the future, scripts would need to be updated.

Upon first glance, it looks like a reliable way of know that SD Notary has totally finished would be for the last line of the “Submission Log.txt” within a “My App - Notarized” file to end with “Stapling succeeded.” At least that file has the latest modification date of any other file in the “My App - Notarized” folder. Or would you suggest a better way to detect that SD Notary is successfully finished?

Also, what would you say are the best ways to detect failure? I haven’t had a failure in a while so I can’t remember the name the folder gets when that happens. It is “My App - Notarization Failed”? Or is it Failure, or Error, or something else? Also are there other error folder names to look out for?

Thanks so much for you help and advice with this.

If the submit app command returns without throwing an error, you know it has successfully finished (and the path to the notarized version).

Ah, very cool. I didn’t realize submit app was blocking until it finished. I should have looked closer at the scripting dictionary. Thanks so much for pointing me in the right direction on this.