Add AppleScripts to Git repository

applescriptcontactsgitms office

I have a few AppleScript files that I would like to share with the community on GitHub.

The files are located in two distinct directories:

  • ~/Library/Scripts
  • ~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items

With this structure preserved, I could edit the files in situ, without having to constantly move files to/from a unified, script directory.
a
Questions:

  1. Can a single repository contain multiple, unrelated directories?
  2. If a contributor forks my repository ($ git clone https://github.com/username/applescript.git), will the directory structure be preserved?

** edit 1 **

  1. Logistically speaking, how and where would I create the local Git repository? Seems like adding it to ~/Library/Scripts would be the easiest.
  2. Do the individual applications even recognize scripts that have been located in the ~/Library/Scripts/Applications/* folder? Or is this merely for organizational purposes.

Unfortunately, Outlook for Mac 2011 does seem to recognize the scripts located in the ~/Library/Scripts/Applications/Outlook folder, aliased (haven't tested a symlink) to the ~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items folder.

** edit 2 **

The scripts referenced by a symbolic link are not recognized by Outlook's AppleScript menu.

$ cd ~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items
$ ln -s ~/Library/Scripts/Applications/Outlook Outlook

Best Answer

I recommend keeping git out of your ~/Library folders, both to keep things simple for people using your scripts, and for stability's sake (I'd argue that the Library's contents should be considered an implementation detail of OS X that you can't rely on not to change on you in future versions).

Instead, I would just copy all the scripts in their textual form into a separate folder for the git repo (~/applescripts, for example), share that, and include instructions for where the user should install the scripts in your README file.