applescript.tmbundle icon indicating copy to clipboard operation
applescript.tmbundle copied to clipboard

Compile and Run sometimes changes the source code

Open doekman opened this issue 9 years ago • 0 comments

I haven't been able to reproduce this issue, but it basically making me not use TextMate with AppleScript. So I file the issue anyway.

Steps to reproduce:

  1. Open an AppleScript text file
  2. Press Cmd+B (Bundles>AppleScript>Compile)

Expected result: a) A window opens with the compilation result b) Original source code keeps unchanged

Actual result: a) A window opens with the compilation result (same) b) Original source code is changed. I've seen three different situations: 1. All non-ASCII characters (like é, ≠, «, and ¬) are changed. I add a comment to what exactly they are changed too. 2. The complete source code is changed to Asian-characters like 畳攠䅰灬敓捲楰琠癥牳楯渠∲⸴∊畳攠獣物灴楮朠慤摩瑩潮猊畳攠晲慭 (file included as Pashua-error-save.applescript.zip). The weird thing is, quick view was showing the original code, but when opening the file in TextMate or Script Editor, all I see is these Asian characters. 3. I also saw the string "<<<<Local Changes` being appended to the beginning of the file, and Asian characters (from above point) being appended at the end of the file. I'm pretty sure I was not editting the file in another editor.

Environment: OS X 10.11.6, TextMate 2.0-beta.12.4, point b.1 has happend to me both on my iMac (24-inch, Early 2009) and on my MacBook Pro (Late 2012). Also a co-worker reported behaviour as mentioned in point b.1. Points b.2 and b.3 have only happened on my iMac until so far.

I've also tried revering to defaults.

The AppleScript I'm using is also calling the command line with do shell script, and some ASOC-calls (NSString/NSMutableDictionary).

doekman avatar Oct 18 '16 11:10 doekman