2

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
1
  • 1
    To keep things simple for people using your scripts, I would just copy all the scripts into a separate folder for the git repo (~/applescripts, for example), share that, and include instructions for where the scripts should be placed in the README.
    – Dan J
    Commented Sep 6, 2013 at 15:51

2 Answers 2

2

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.

1
  • +1 "I recommend keeping git out of your ~/Library folders" I think that you make a good point about not putting the git repository into the ~/Library folder.
    – Kaydell
    Commented Sep 6, 2013 at 19:43
1

Ideally, AppleScripts should be saved as text (with the .applescript extension) to take full advantage of the features of git which works best with text files.

You could possibly add AppleScripts as binaries (with the .scpt extension) that would work. I mean you could check the binaries in and out of a git repository.

I believe that you could place your local git repository in a common super-directory such as:

~/Library

  1. Can a single repository contain multiple, unrelated directories?

Yes.

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

I believe so. The other user would have to place the forked repository in the right place: ~/Library for the scripts to work like yours do. Although they could place the forked repository anywhere if they wanted to.

You could try forking the repository in another account on your own computer to test how this would work for other people.

An alternative to what you are proposing is to have two local git repositories, one for each folder.

1
  • I agree: it's better to version control the .applescript files. I can add instructions to the README file on how to compile it (⌘K).
    – craig
    Commented Sep 6, 2013 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .