I'm writing a command to open tmproj files and I've narrowed it to opening a folder from the project, and opening the files that were open when the project was saved. Anything else is too messy to transform into the Avian equivalent. I do have a couple questions before I will be able to complete it:
*How to manipulate the file browser from a (Ruby) command?*
*How to open a file from a (Ruby) command?*
Also, a couple general purpose questions:
*How to run a bundle from another bundle (if possible)?*
*How to output to both document and web preview with a command (if possible)?*
Bugs:
Found a bug in the File Browser: Renaming a favorite to the same filename with a changed case (e.g. myfavorite -> MyFavoRite) causes "Failed to rename the file at “MyFavoRite. Error: File exists"
---
The new Ruby support scripts look fantastic. I see some cool bundles in TextMate's future.
Brandon
On 18 Dec 2011, at 21:32, Brandon M Fryslie wrote:
[…] *How to manipulate the file browser from a (Ruby) command?*
There is no scripting support for things like this.
*How to open a file from a (Ruby) command?*
You can call upon the ‘mate’ shell command available via %x{ "$TM_SUPPORT_PATH/bin/mate" «file» }.
*How to run a bundle from another bundle (if possible)?*
You can run scripts from other bundles. You need to setup a requirement in the plist and then you get the TM_«bundle»_SUPPORT_PATH which you can then use to access the script — I believe exact details are in the help book.
*How to output to both document and web preview with a command (if possible)?*
Output can only go to one place. You can however use $DIALOG or similar to show output dialogs / tool tips.