[SVN] Bundle commit 385

allan at macromates.com allan at macromates.com
Mon Feb 28 00:14:07 UTC 2005


This is one idea for how to solve the settings problem.

Basically call this script, it will read the path from the actionscript defaults, if no path exists (or the stored path is not a folder) it will prompt the user with a folder dialog and store the choice (if it's a valid folder) for future use.

So basically in a shell script it should be possible to do:

DOC_PATH=`"$TM_BUNDLE_PATH/get_doc_path.sh"`
if [[ -d $DOC_PATH ]] then
   ...
fi

And the user will only be prompted for the folder the first time he runs the command, or if the path later goes invalid.

I didn't actually make any of the commands in the bundle use this script, since I don't have the flash documentation installed and wasn't sure which commands actually needed the path.

There is one minor problem with the script; the “defaults” command I use to read the setting returns the path with >7 bit characters as escape sequences. I have no idea how to make it return something more useful (interestingly when writing defaults values, it expects utf-8). If I don't find a solution for this, we can always just grep the output through perl to turn escape sequences into characters -- but it sucks!

Changed:
A   trunk/ActionScript.tmbundle/Tools/get_doc_path.sh



More information about the textmate-dev mailing list