Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RichardBronosky/AppleScript-droplet
A template for creating Droplets for Mac OS X that will pass dropped files to an embedded script
https://github.com/RichardBronosky/AppleScript-droplet
Last synced: 4 months ago
JSON representation
A template for creating Droplets for Mac OS X that will pass dropped files to an embedded script
- Host: GitHub
- URL: https://github.com/RichardBronosky/AppleScript-droplet
- Owner: RichardBronosky
- Created: 2013-03-01T18:32:53.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-03-01T21:52:53.000Z (almost 8 years ago)
- Last Synced: 2024-08-01T16:55:41.746Z (7 months ago)
- Language: Shell
- Size: 65.4 KB
- Stars: 64
- Watchers: 7
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

AppleScript-droplet
===================A template for creating Droplets for Mac OS X that will pass dropped files to an embedded script
How to use
=========='Inception' method
------------------
1. Drop an executable script or binary onto the "script2droplet-droplet" icon in Finder
2. There is no step 2Manual method
-------------1. Replace the `main` file in "Show Package Contents" Contents/Resources/Scripts with the script you want run
2. There is no step 2How to edit
===========The only "drag-and-droppable" save option for AppleScript is "File Format: Application". This has the side effect of **not allowing** you to right click the app in Finder and choose "Open with...". To edit, you have to either drag this app on top of the AppleScript Editor app, or from the command line do:
open -b com.apple.ScriptEditor2 script2droplet-droplet.app
Editing the AppleScript will allow you to change 3 options:
## Set use_terminal to true to run the script in a terminal
set use_terminal to true
## Set exit_terminal to false to leave the terminal session open after script runs
set exit_terminal to true
## Set log_file to a file path to have the output captured
set log_file to "/tmp/droplet.log"Making git binary friendly
==========================Because AppleScript stores its code in a binary format, it is difficult to use with version control. The included `.gitconfig` can be added to your .git/config to allow text conversion before diffing. It complements the included .gitattributes file
Add it to your .git/config like so:
cat .gitconfig >> .git/config
Alternatively, you can use a git 1.7.10+ style include by adding these lines to your .git/config
[include]
path = ../.gitconfigSample scripts
==============file.sh
-------
Just uses the BSD command "file" to return info about each of the dropped files.script2droplet.sh
-----------------
This is a script that, when placed in a droplet, will create a droplet from the dragged script. Yo dawg!
A copy of this is used as the default `main` in `AppleScript-droplet.app/Contents/Resources/Scripts/`[dropbox.sh](http://i.imgur.com/QA2GQdR.png)
----------
Uploads each of the dropped files to a configurable folder in Dropbox and returns (and copies) the public URL (assuming you have configured it to use a public folder).
Requires [Dropbox-Uploader] be installed and configured in advance.[imgur.sh](http://i.imgur.com/LmUvWqB.png)
--------
Uploads each of the dropped files to imgur and returns (and copies) the public URL.
Currently these are anonymous. (patches welcome)Using the sample Scripts
========================Dropbox
-------
Create a new Dropbox Droplet like so:cp -r AppleScript-droplet.app Dropbox-droplet.app
cp scripts/dropbox.sh Dropbox-droplet.app/Contents/Resources/Scripts/mainImgur
-----
Create a new Imgur Droplet like so:cp -r AppleScript-droplet.app Imgur-droplet.app
cp scripts/imgur.sh Imgur-droplet.app/Contents/Resources/Scripts/main[Dropbox-Uploader]: https://github.com/andreafabrizi/Dropbox-Uploader