Hi,
I work with Changes Version 1.6.2 (582) and I install the bundle for Textmate. But with TM2 i get a bug when I try to compare files with Compare two front documents .
Textmate blocks and I can't do nothing
Best regards
Alain Matthes
Le 29 mars 2013 à 16:54, Alain Matthes alain.matthes@mac.com a écrit :
Hi,
I work with Changes Version 1.6.2 (582) and I install the bundle for Textmate. But with TM2 i get a bug when I try to compare files with Compare two front documents .
Textmate blocks and I can't do nothing
More information : I can use Selected Files in Project Drawer like with Diff bundle but I prefer to use the two front documents.
The command for front documents is :
#!/usr/bin/env bash [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
# Compare the two frontmost documents
# This is the way it _ought_ to work # $f1=osascript -e 'tell app "TextMate" to return path of document 1' # $f2=osascript -e 'tell app "TextMate" to return path of document 2'
# Get the paths to the two frontmost documents f1=$(osascript<<END tell application "TextMate" set theFile to path of document 1 set the result to POSIX path of theFile end tell END)
f2=$(osascript<<END tell application "TextMate" set theFile to path of document 2 set the result to POSIX path of theFile end tell END)
# And send them too the comparison tool # diff -u "$f1" "$f2" # opendiff "$f1" "$f2" # bbdiff --ignore-spaces "$f1" "$f2" chdiff "$f1" "$f2"
but I'm not an expert with applescript
Best regards
Alain Matthes
On 29 Mar 2013, at 18:27, Alain Matthes wrote:
# Get the paths to the two frontmost documents f1=$(osascript<<END […]
TextMate 2 does not support AppleScript.
An alternative would be to use TM_SELECTED_FILES and require documents to be selected in the file browser, using current document (TM_FILEPATH) with a selected one, or open a file dialog to select what the current one needs to be compared against.