Hi!
I tried to Drag'n'Drop an image from the Finder (or the Project
Drawer) to the Textmate.
On my iBook its working w/out any problem, on my new iMac I get the
folllowing error (and nothing else):
/usr/lib/ruby/1.8/pathname.rb:529:in
I tried to shorten the filename, I tried to remove the space from the
folder-name where the project is in and nothing helped (and I don't
know ruby that well for having an idea what's up with the file from
above)
Both TextMates are at Version 1.5.3(1269) and I checked out the
actual svn-version.
Any help appreciated :)
Niels
Sorry for the newbie question, but how do I run the script I'm looking
at, with arguments? For example I'm editing a Ruby script and I want to
run it, supplying a filename that the script is to pick up as ARGV[0]
and read. I can't believe that the answer is "use the Terminal"; surely
I can stay in TextMate and do this, in some way that I'm just failing to
see. Thx - m.
--
matt neuburg, phd = matt(a)tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
Is there a way to open all the files in a given group/folder, or all
selected files perhaps?
-- fxn
PS: The motivation is I am using TM to give a talk (inspired by DHH's
keynote at RailsConf Europe). All the files/slides live in a group
and to start the presentation it would be handy to have them opened
in one shot, and in their relative order.
PS2: I just discovered you can use a remote to do a presentation with
TM since Mira and friends let you map buttons in Apple Remote to
⌥⌘←/→. There's order in the Universe.
I have the following drag command for zip files to be inserted as snippet:
echo -n "<a href=\"http://$TM_REMOTE_URL/file_download/\${1:file_id}\"
title=\"\${2:"$TM_DROPPED_FILE"}\">\${3:"$TM_DROPPED_FILE"}</a>"
This will insert a download snippet for a default URL on a live server.
However, I would like to strip the path somehow from the variable.
Does anyone know how to do this,through a substitution reg ex maybe ?
Additionally a variable named $TM_FILE_NAME (That would just insert the
name of the file instead of $TM_DROPPED_FILE would make much sense here
for such a drag command, where you don't care
so much about the path.
regards, marios
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi, again
Can any Ruby Guru tell me, what is wrong with this code.
http://pastie.caboo.se/17615
It gives me a syntax error.
The Ruby version is 1.8.2
It has been working before, and ceased to do so , after removing one
tag item from the txp_single array.
It is a slight modification of the html version.
regards, marios
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: This might change in the future
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFMIYv8tSzPOYuZvQRAgdYAJ47wnqk9T8O++jYPDuqp0Ls7PyWJACgu8AE
Ks+KAlpVY4bwEYdC58NAgfY=
=6SzG
-----END PGP SIGNATURE-----
Search within project is great, but as projects grow, it becomes slower to
perform a search within the project. I would be fantastic to be able to
search within a selected Folder or Group. Is this in there somewhere an I'm
missing it?
-dave
Is it possible to create a bundle that exists only within a project? I
often have instances of commands, snippets, or scripts that I only need/want
within the context of a certain project. It would be fantastic if I could
have a bundle that only existed for a certain project.
-dave
Hello,
seems that Smoot Scrolling doesn't work in TM like in any other cocoa
app (e.g. colloquy).
Someone experienced this?
(I have asked for this in irc today, without answer)
How to type Chinese or Japanese with TextMate?
Sometimes I have to write scripts, html pages, etc. with Chinese,
Japanese, Korean, etc. strings.
The problem is that within TextMate I cannot use e.g. Kotoeri (the
Japanese Input Editor) because I don't see what I'm typing. In order
to avoid to change to an other program I wrote a very easy code
snippet with CocoaDialog's textbox feature.
Here is one way to use my suggestion:
- open the Bundle Editor
- Show all
- go to the folder 'TextMate' (or whatever)
- add a new command 'inputCJK' (or whatever)
Command data
- Save: nothing
- Command(s):
# open CocoaDialog's textbox
res=$(CocoaDialog textbox \
--title "Input CJK" \
--informative-text "Write up here..." \
--selected \
--scroll-top top \
--editable \
--no-newline \
--button1 "Insert" \
--button2 "Cancel")
# If user canceled exit.
[[ $( (tail -r <<<"$res") | tail -n1) == "2" ]] && \
exit_discard
# delete first line
res=$(sed '1,1d' <<<"$res")
# print the content of the textbox
echo -n "$res"
Input: None
Output: Insert as Snippet
Activation: Key Equivalent shift+option+i (or whatever)
Scope: leave it empty
With the help of this script you are able to use Kotoeri or other IME
within TM indirectly.
I know that isn't the most elegant way but for writing small scripts
using some Japanese, Chinese strings is quite good.
Of course, TM has some problems to display Chinese characaters but, as
I mentioned before, for smaller things it is sufficient. ;)
Hopefully the very tiny script is useful for others as well. Feedback
is highly welcomed.
Many greetings,
Hans-Jörg Bibiko
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Many users mentioned that there is sometimes the need to open a file
which is encoded in e.g. Chinese Big5 or in Japanese Shift-JIS.
The TextMate manual recommends in respect to that topic to use the
UNIX command 'iconv'. It works perfectly, but if you have to open many
files of different encodings the typing of such commands will become a
bit uncomfortable.
To make it a bit easier I wrote with the Bundle Editor a new template
called openEncodedFile based on CocoaDialog's features.
Here is one way to use my suggestion:
- open the Bundle Editor
- Show all
- go to the folder 'TextMate' (or whatever)
- add a new template 'openEncodedFile' (or whatever)
Template data
- Extension: leave it empty
- Command(s):
# open CocoaDialog's file select menu
file=$(CocoaDialog fileselect \
--title "Open an encoded file" \
--with-directory $HOME/ \
)
# check for valid file
if [ -n "$file" ]; then
# open CocoaDialog's dropdown menu
# for more encodings add them to '--items'
# to list all possibile encodings use the Terminal with 'iconv -l'
res=$(CocoaDialog dropdown \
--title "Open an encoded file" \
--text "Choose the encoding:" \
??exit?onchange \
--button1 "Open" \
--button2 "Cancel" \
--items "BIG5" "EUC-TW" "GB2312" "SJIS" "EUC-JP" "KOI8-R" \
)
# if user canceled exit
[[ $( (tail -r <<<"$res") | tail -n1) == "2" ]] && \
exit_discard
res=$(tail -n1 <<<"$res")
# add more 'elif' according to '--items' if needed
if [ "$res" == 0 ]; then
ENC="BIG5"
elif [ "$res" == 1 ]; then
ENC="EUC-TW"
elif [ "$res" == 2 ]; then
ENC="GB2312"
elif [ "$res" == 3 ]; then
ENC="SJIS"
elif [ "$res" == 4 ]; then
ENC="EUC-JP"
elif [ "$res" == 5 ]; then
ENC="KOI8-R"
fi
# start conversion to UTF-8 and send the result as a new file back to TM
iconv -f "$ENC" -t utf-8 "$file" > "$TM_NEW_FILE"
fi
- Output: Insert as Text
- Activation: Key Equivalent shift+option+o (my suggestion)
- Scope: leave it empty
I've chosen a new template because the used keyboard short-cut is also
available if no document is open.
As you can see in the script you can add/edit encodings very easily.
(More details within the code)
If you start that bundle (shift+option+o) you will see a file choose
menu. Select your file and press ENTER or 'Open'. Then you will be
asked to input the right encoding. The available encodings are listed
in a drop-down menu. Select one encoding and press ENTER or 'Open'.
The script will convert your file according to the selected encoding
to utf-8. The result will be shown in a new document.
Hopefully the very tiny script is useful for others as well. Feedback
is highly welcomed.
Many greetings,
Hans-Jörg Bibiko
PS TODO: Include an automatical encoding detection. Hopefully coming soon ;)
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.