Hi to all,
Suppose, I have a document with HTML like tags, where each unique tag attribute of a specific tag corresponds to a file not in the same Folder, but a sibling folder of the documents window parents folder.
I'm trying to make a command, that when triggered via key equivalent will open that correspondent file, if the caret is on that scope.
I've managed just to filter the filename. eg.: if I do:
find "$TM_DIRECTORY/.." -name "$TM_CURRENT_WORD*article.txfml" -exec basename "{}" ;|sort
then this will give me the desired filename which is mrs_promo.article.txfml.
My question is, how can I make this command, so that it will open this file inside my project, even if it is not open as a project tab.
Or, alternatively to open an Html window, with a link, when clicked on, will take me to the file.
I've looked around a bit, if I can find an example in other Bundles, but only saw Ruby examples.
(Sorry, for bothering again, I promise, this will be the last question for the next 2 weeks)
regards, marios
On 7. Oct 2006, at 06:05, marios wrote:
find "$TM_DIRECTORY/.." -name "$TM_CURRENT_WORD*article.txfml" -exec basename "{}" ;|sort
then this will give me the desired filename which is mrs_promo.article.txfml.
My question is, how can I make this command, so that it will open this file inside my project, even if it is not open as a project tab.
Try add: ‘|xargs mate’ to your command.
Or, alternatively to open an Html window, with a link, when clicked on, will take me to the file.
That would be generating the HTML for that, where you can use txmt: as the URL scheme to have links open (as files) in TextMate. See the HTML Output part of the manual for further details.
I've looked around a bit, if I can find an example in other Bundles, but only saw Ruby examples.
Quick Open in the C command does something along these lines (as a bash script)
Allan Odgaard wrote:
On 7. Oct 2006, at 06:05, marios wrote:
find "$TM_DIRECTORY/.." -name "$TM_CURRENT_WORD*article.txfml" -exec basename "{}" ;|sort
then this will give me the desired filename which is mrs_promo.article.txfml.
My question is, how can I make this command, so that it will open this file inside my project, even if it is not open as a project tab.
Try add: ‘|xargs mate’ to your command.
Something like this:
AFORM="`find "$TM_DIRECTORY/.." -name "$TM_CURRENT_WORD*.txfml" -exec basename "{}" ;|sort`" open "$TM_DIRECTORY/../forms/$AFORM"
worked for me. I couldn't find the correct syntax for x-args. Thanks again for all your help.
regards, marios