I manage my applescript in github. When we moved to github, we switched all our scripts to .applescript plain text files for git compatibility. We deploy via script, and the deployment scripts parse metadata from the scripts themselves to see the filetype to deploy as (ie, run-only, .scptd, .app, etc) and figure out where they’re deploying to based on the GIT branch, read from the .git/HEAD file.
This works, but there are serious issues. Anything that must contain resources, so deployed as a .app or a .scptd bundle, we’re having the deployment code save over the .scpt file inside the bundle at:
[bundle name].scptd/Contents/Resources/Scripts/main.scpt
But this prevents us from managing the bundled resources on git.
Additionally, for our .apps, I think updating the .scpt inside breaks code signing.
Also, bundle and export settings for Script Debugger aren’t saved with the .applescript file, although we could store those values in the script metadata, parse them out, and set the values via script on export.
Libraries with dictionaries also don’t play nicely with this. The .applescript copy in our git folder won’t compile, because it’s disassociated from the dictionary inside the .scptd.
All in all, it’s a less than ideal solution.
I was excited when I heard that Script Debugger added a feature intended for helping with Version Control. In Preferences → Building, there’s now the checkbox for:
Saving Script Bundles
Save .scptd files in version-control-friendly format
Checking this option causes .scptd files to be saved with their source internally in both .rtf and .scpt format. When opening, the .rtf format is always preferred.
This sounds great - I can use .scptd bundles, AND use git.
But in git, .rtf’s aren’t rendered. Researching this, I found this thread:
[I tried linking, but is says I can’t put links in posts, so I butchered it] forum.latenightsw [com] /t/applescript-support-and-vcs-support/520/40
Which seems to confirm the issue.
Am I missing something? It doesn’t seem practical to merge .rtf’s in git, making this feature not-useful.
Is there a git extension to render rtf’s, instead of displaying the raw markup? A 3rd party merge tool people are using that supports .rtf?
Or from another angle - if the purpose of this feature is Version Control compatibility, why is Script Debugger using a .rtf, if .rtf is not standardly (usefully) compatible with Version Control? If this is the intended use, why not a .applescript text copy of the source inside the bundle, that Script Debugger prioritizes when opening?
I feel like I’m missing something, given that the preferences pane specifies this feature as being specifically for GIT compatibility.
Thanks,
Tom.