User Name
Password
AppleNova Forums » Programmer's Nook »

addition to TextEdit toolbar??


Register Members List Calendar Search FAQ Posting Guidelines
addition to TextEdit toolbar??
Thread Tools
bruce
Member
 
Join Date: Mar 2005
Location: south carolina
 
2006-03-23, 16:06

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
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-23, 19:05

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
atomicbartbeans
reticulating your mom
 
Join Date: Jan 2005
Send a message via AIM to atomicbartbeans  
2006-03-23, 19:21

Maybe try an AppleScript?
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-23, 19:37

Yeah, I though about mentioning that too. AppleScripts can execute shell commands like you're doing.
  quote
rollercoaster375
Senior Member
 
Join Date: Mar 2005
Location: UIllinois (Champaign, IL)
Send a message via AIM to rollercoaster375 Send a message via MSN to rollercoaster375 Send a message via Yahoo to rollercoaster375 Send a message via Skype™ to rollercoaster375 
2006-03-23, 21:57

Well, if you install the dev tools, you could mess around with TextEdit. Apple includes the source (Which allowed me to unify TextEdit).
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-23, 22:51

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
bruce
Member
 
Join Date: Mar 2005
Location: south carolina
 
2006-03-24, 05:29

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
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-03-24, 05:33

Quote:
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.
Is that the reason all your posts don't use paragraphs properly?
  quote
euain
Member
 
Join Date: Jan 2005
Location: UK
 
2006-03-24, 05:42

Quote:
... 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.
Automator might be the tool you need for this?
  quote
Majost
monkey with a tiny cymbal
 
Join Date: Nov 2004
Location: Lost
 
2006-03-24, 05:55

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 06:06. Reason: Macintosh HD:stupid:legacy:path:style
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
vi editor, TextEdit bruce Genius Bar 3 2005-11-29 14:17
Can't Permanently Remove Adobe Acrobat PDFmaker Toolbar in Microsoft Word SonOfSylvanus Genius Bar 4 2005-03-05 06: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


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 04:05.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2014, AppleNova