For casual, unsophisticated applications by someone who grew up with green screen character based computers, it's probably OK. For this reason, I would not recommend Emacs to anyone who is under 50 year old, or who needs power user capabilities. The things I just mentioned, are all present in some limited and inept form, but falls far short of current standard of good user interface design. To this day, it lacks or struggles with very basic things, like interactive dialogs, toolbars, tabbed interface, file system navigation, etc., etc. So Emacs does 5% or what an editor should do quite will, and is surprisingly under-powered and old fashioned at the other 95%. Unfortunately, it didn't keep up with the times and fails to take advantage of the entire world of GUI design that's revolutionized computer science since then. In fairness to Emacs, its original design was conceived in that context and is rather good at some things, like flexible ability to bind commands to keyboard shortcuts. Note: This was tested under OS X 10.8.5 and TextWrangler v4.5.9 (3390) and may react differently in other versions of OS X and or TextWrangler.User interface is terrible I was using Emacs in the early 1980's, before there were GUIs. Image of code showing syntactical highlighting: You can uncomment and modify if/as necessary. The value is in seconds expressed decimally. Lastly, a while back I wrote a shell script to format my XML. It makes manipulating text a breeze, and its price just. Enter the keyboard shortcut and press the Set button. TextWrangler is an excellent text editor for anyone who needs to work with large amounts of text, text in large numbers of files, or both. Highlight an option and press the Set Key button. Note that I've commented out the delay command with - and may or may not be needed depending on if Terminal is initially closed and or how slow your system responds. In the menu header, find the option (s) you want to add a keyboard shortcut to. It either executes your current selection, or the line on which your cursor is. You can assign a shortcut by going to the Window menu in TextWrangler, then choose Palettes -> Scripts and assign a shortcut, for instance cmd-return for the same behavior as the built-in R text editor. ![]() ![]() Looking in mail.log, I can see the history - including the delivery information. Set the_selection to line (get startLine of selection) of front window as stringĭo script with command the_selection in front window Put this in /Library/Application Support/TextWrangler/Scripts/. This simple two line script is: /bin/bash mail -s 'Subject' email address < /tmp/message.txt If I run that last line from the command line, I get a text message on my Verizon cell phone. Set the_selection to (selection of front window as string) ![]() So I experimented with a few different solutions I saw and the code I'm using is shown below. So a Google query yielded much useful information. In other words, if Terminal is closed when executing the script, then the code as written can produce an error, e.g.: "A scripting error has occurred: Terminal got an error: Can’t get window 1."Įven telling Terminal to activate didn't open a window like it does when opening Terminal from the Dock Tile I have set to "Keep in Dock" and I'd get the aforementioned error. That said, the script you have, as written may fail as Terminal can be a bit finicky. You can open it from TextWrangler's Script menu, Open Scripts Folder command and place the script or link to the script from wherever you saved it.įor the purpose of answering this question I created an AppleScript named Run Selected Line(s) in Terminal.scpt and placed it in TextWrangler's Script folder and is now available on the Script menu in TextWrangle as show in the image below. Note: The "~" in that path is your Home Folder and the Library folder may not be visible. In order to use an AppleScript script in TextWrangler's Script menu, it (or a link to it) must be in TextWrangler's Script folder located at, ~/Library/Application Support/TextWrangler/Scripts in order for it to appear on the menu.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |