Dear all,
here comes my first approach for a BASH function to export
<key>=<value> out from a property list.
#
# exportpl set BASH variables according to the property list <key>=<value>
#
# if <value> is an array tag a BASH array will be returned
# if <value> is a date tag output format YYYY-MM-DDTHH:MM:SSZGMTshift
#
# all variable values are UTF-8 encoded
#
# if a given key is not specified in plist an empty string will be returned
#
# each variable is named TMD_<key> (with prefix TMD_)
#
# Usage:
#
# exportpl <data|file> {key1 key2 key3 ... keyn}
#
# data := string containing valid plist data
# file := plist file [.plist extension is not necessary]
# key1...keyn :=?valid key(s) for plist
#
#
# Examples: ('output' is an array with 8 items)
#
# a)
# KEY=("returnCode" "output")
# . "$TM_BUNDLE_SUPPORT"/bin/exportpl.sh
"$TM_BUNDLE_SUPPORT"/bin/test.plist ${KEY[@]}
# echo $TMD_returnCode
# echo ${TMD_output[0]}
#
#
#
# b)
# . "$TM_BUNDLE_SUPPORT"/bin/exportpl.sh
"$TM_BUNDLE_SUPPORT"/bin/test returnCode output
# echo $TMD_returnCode
# echo ${TMD_output[5]}
#
# c)
# DIA=$( cat "$TM_BUNDLE_SUPPORT"/bin/test.plist | tm_dialog -m test )
# . "$TM_BUNDLE_SUPPORT"/bin/exportpl.sh "$DIA"
# #all key(s) for $DIA are exported
#
What should I add/change/etc. ?
I used the objectC2Perl bridge to parse the plist data. The only thing
I don't know yet whether the perl library 'Foundation' is installed as
default. Tomorrow I will check this at a fresh Mac installation
without 'Developer Toolkit'.
Cheers,
Hans-Jörg
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
when i try to use "Log" I get following error:
(a project is open, and i am in a file, that i just successfully
committed to a svn repository)
anyone knows what could be wrong?
I never installed any bundles. just the default TM install.
NoMethodError
reason: undefined method `text' for nil:NilClass
trace:
/Applications/-moreApplication/TextMate.app/Contents/SharedSupport/
Bundles/Subversion.tmbundle/Support/format_log_xml.rb:22:in `author'
(erb):32
/usr/local/lib/ruby/1.8/rexml/element.rb:939:in `each'
/usr/local/lib/ruby/1.8/rexml/xpath.rb:53:in `each'
/usr/local/lib/ruby/1.8/rexml/element.rb:939:in `each'
/usr/local/lib/ruby/1.8/rexml/element.rb:398:in `each_element'
/Applications/-moreApplication/TextMate.app/Contents/SharedSupport/
Bundles/Subversion.tmbundle/Support/format_log_xml.rb:18:in `each_entry'
(erb):28
/Applications/-moreApplication/TextMate.app/Contents/SharedSupport/
Bundles/Subversion.tmbundle/Support/format_log_xml.rb:165
Hi Michael:
I've put the stuff here: http://xanana.ucsc.edu/xtal/
textmate_extra_bundles.tgz
Please remember this is still rather rough, and I'm not sure I'm
doing things right.
Almost everything I have in this either would work with bash or will
work with trivial modifications (I could change "print" to "echo" and
figure out a workaround to the different array indexing conventions
(zsh defines the first element of an array as having index 1, bash
and every other computer language seem to agree on 0).
So if some of these things were to be incorporated, I suggest that a
separate zsh bundle not be made. bash has become more and more zsh-
like in syntax, and the stuff like [[ condition ]] used in zsh is
already in the Scripting Bundle.
If there is to be a new shell script bundle, I would suggest having
two scripting bundles: One that is Bourne/Korn-like, and one that is
tcsh-like, in its syntax. This is a more natural divide. The current
Scripting Bundle isn't really useful for tcsh scripts apart from the
syntax highlighting and commands. It probably isn't worth the
trouble to have a separate zsh bundle. Most people script in bash.
I like zsh because I learned ksh and it is quite elegant, but isn't
as portable (yet) as bash. I've been happily using (and adding to)
the bash-centric scripting bundle for a couple of months now.
In my zsh bundle, I've got a bunch of shell/osascript snippets. I
think changing print to echo is all that would be needed to make them
bash-compatible (at least the ones I just tested). I don't know if
they would be of general interest, but they permit the scripter to
use some simple OS X gui elements in their shell scripts, which is
kind of entertaining.
I modified the "Run Script" command to permit the user to enter
arguments to the shell script before running it. Although I wrote
the command in zsh, there is no reason why bash or tcsh users can't
use it. Maybe it should be shift-command-R (if that is not taken) to
allow the user the choice.
I also put in some conditional test snippets and a few other generic
things that may or may not be of interest.
HTH,
Bill
William G. Scott
contact info: http://chemistry.ucsc.edu/~wgscott
The problem was that I had a category called out-of-office and evidently it
couldn't handle the hyphens. Thanks.
--
Lawrence Goodman
lawrencegoodman(a)gmail.com
Check out my blog: http://goodmanorama.blogspot.com
Hi citizens:
I found myself extensively modifying the Shell Script bundle for zsh-
specific things. I eventually experienced what drunks refer to as a
moment of clarity: Maybe having a separate ZSH bundle would be a
good thing. So I renamed the bundle to zsh, then edited the Shell
Script (bash) Language file, changed scopeName to 'source.zsh', and
then changed all other instances of source.shell to source.zsh in
the Scope Selector window in the other files.
It seems to work, but then when I went to put the default Shell
Script bundle back in, it instead reversed changes I had made in
stuff in the new zsh bundle.
So I deduced I am doing something wrong, that TextMate still
identifies this with the previously named bundle, and the two won't
co-exist until I fix the problem.
However, since I took a rather backward approach, I am not clear on
what else I need to change in order for TextMate to recognize my
attempt at a zsh bundle as something separate from the old Shell
Script bundle. I've made some new bundles de novo, but I an not
clear on how to fix the mess I made here.
Thanks.
Bill
PS: Once I have something nonpathological, I am happy to share it.
I got rid of the menuenabler bundle that was causing one of the error
messages. Now what I get is:
/Users/BAMWriter/Library/Application
Support/TextMate/Bundles/GTDAlt.tmbundle/Support/bin/gtdalt_ical_synchronization.scpt:
execution error: The variable the_cal is not defined. (-2753)
--
Lawrence Goodman
lawrencegoodman(a)gmail.com
Check out my blog: http://goodmanorama.blogspot.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
I tried to convert a Markdown file to RTF, but all german Umlauts
were broken.
To fix this I added "-inputencoding UTF-8" to the textutil command in
the Bundle Editor. This is not a clean fix because the input file
could have any encoding but I don't have a better idea how to fix this.
I also tried the other commands, but they have some problems too:
The "Convert to LaTeX" commands are not working. They fail with the
following message:
- -:3: parser error : Extra content at the end of the document
<ul>
^
unable to parse -
And "Convert to PDF" fails because it can't find htmldoc, don't know
if it should be installed on my computer.
Could anybody please look into these problems.
Thanks in advance,
Simon
- ----
> privacy is necessary
> using http://gnupg.org
> public key id: 0x6115F804EFB33229 http://ruderich.com/
simonruderich.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFWPNiYRX4BO+zMikRCm5MAJ47incaZnE1sB60t6zlDWSaPIyyTgCgvd57
JVz7yakx3ptHvmCk3gvCpEQ=
=oxjq
-----END PGP SIGNATURE-----
Hi -
Textmate's (or the Latex bundle's) ability to tell when to use
xelatex instead of pdflatex has stopped working for me. Documents
that compiled quite happily yesterday won't do so today. I checked in
the Latex bundle's "Typeset and View" command to see whether anything
had changed, but the relevant lines are still there:
> # Set up TeX compiler, fallback to xelatex if document indicates it,
> if grep -Esq '\\usepackage{.*(xunicode|fontspec)|program=xelatex' "$M"
> then DEF_TEX=xelatex
My xelatex documents all have \usepackage{xunicode} and \usepackage
{fontspec} in them, so this should work just fine, and has been
working fine. But it doesn't now. Instead Textmate tries to run
pdflatex on the document, resulting in a failure.
The only thing that's changed is that this morning I updated the
Latex bundle and the Support folder from the subversion repository.
Has something changed in there that would cause this problem?
Best,
Kieran
Hi Haris,
let's compromise :)
It's again my request that arbitrary text lines (for notes)
can be included in gtd files (and simply ignored
by the parser). Are you really against it? This would
give much greater flexibility to the format, with
only some minor risk, but that's my opinion.
But if you are really against, what about the following format:
1) gtd files can be divided into two sections, separated
by some delimiter (e.g., a line like
#### PROJECTS AND ACTIONS ####
or something similar)
2) above the delimiter line I can write anything, it's ignored
by the parser
3) below the line I write projects and actions and here the
syntax is strict: only projects and actions are allowed.
With this kind of format, the flexibility would be enhanced
as I need. At the same time, any mistake in writing
tasks or projects would be spotted by the parser.
What do you think? (Please?)
Ciao,
Piero