Member
Join Date: Mar 2005
Location: south carolina
|
I have written a simple 2 line script that, when used in terminal,
inputs a text file and outputs the text file with lines evened out to about 70 characters and a carriage return at the end of each line. The program uses the unix program fmt which is provided on my machine (OS 10.4.5). My question: is it hard to put this script into the TextEdit toolbar? I envisage it as one of the options under the Format button. I would write my text file using carriage returns at random, click the button, and even out the script. |
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
No, I do not believe you can do this. TextEdit's toolbar is not truly customizable like most other apps' toolbars and, even it was, the standard toolbars do not allow you to link to outside pieces of code.
The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
quote |
reticulating your mom
|
Maybe try an AppleScript?
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Yeah, I though about mentioning that too. AppleScripts can execute shell commands like you're doing.
|
quote |
Senior Member
|
Well, if you install the dev tools, you could mess around with TextEdit. Apple includes the source (Which allowed me to unify TextEdit).
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Holy moley. I totally forgot about that! In the earlier developer tools, Apple only included the source to a Carbonized version of SimpleText. Thanks for the reminder.
|
quote |
Member
Join Date: Mar 2005
Location: south carolina
|
Thanks for your comments. I may look into this, although it seems
complicated. In my earlier, unix life, I enjoyed writing simple shell scripts for one purpose or another. It would be nice to have some executable shell scripts sitting, say, on the desktop, that one could execute somehow with a click of the mouse and that would perhaps take as input some other files sitting on the desktop. |
quote |
‽
|
Quote:
|
|
quote |
Member
Join Date: Jan 2005
Location: UK
|
Quote:
|
|
quote |
monkey with a tiny cymbal
Join Date: Nov 2004
Location: Lost
|
Ooh, I know... an AppleScript Droplet. Just fix the shell path in this script, and save it as an application in AS. I think that this should work. Or at least it will give you enough to run on.
Code:
on run
display dialog ("Drag'n'drop text files to un-line-wrap them.")
end run
on open (txts)
repeat with the_file in txts
do shell script "/path/to/your/script '" & POSIX path of the_file & "'"
end repeat
end open You can also just type in the entire script into the AS file if you don't want to have it in a separate file. Just be careful with quoting and escaping things.Last edited by Majost : 2006-03-24 at 07:06. Reason: Macintosh HD:stupid:legacy:path:style |
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vi editor, TextEdit | bruce | Genius Bar | 3 | 2005-11-29 15:17 |
Can't Permanently Remove Adobe Acrobat PDFmaker Toolbar in Microsoft Word | SonOfSylvanus | Genius Bar | 4 | 2005-03-05 07:32 |
Margins in TextEdit | Frank777 | Apple Products | 7 | 2004-05-25 17:45 |
love the annoucement addition | thegelding | Feedback | 6 | 2004-05-18 22:06 |