Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A few scripts to help with Pine integration UNIX
I installed Pine on my OS X box, and love it. It is the only email program that can keep up with my volume of mail. It is text only, but there is nothing that can touch it for speed and power.

But I wanted to get Pine to play a little nicer with my system. So I wrote a few scripts to:
  1. Open URLs without having to copy and past them.
  2. Print via the GUI print system (via PDF)
  3. Handle attachments so I could view them without having to save them first.
I typed out some quick steps on how I did this for my own use, but thought others might like to look at them as well. Rather than turning them into HTML, I just dumped the text files on my iDisk, listed under the "Pine Tricks for OS X" link.

[Editor's note: I have not used these scripts myself (I'm having enough trouble mastering Mail. app ;-), but I did glance at them and they seem to be well-written instructions with simple, straightforward scripts.]
    •    
  • Currently 3.00 / 5
  You rated: 4 / 5 (5 votes cast)
 
[13,392 views]  

A few scripts to help with Pine integration | 12 comments | Create New Account
Click here to return to the 'A few scripts to help with Pine integration' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
opening URL's from the command line
Authored by: jaysoffian on Apr 05, '02 05:14:23AM

Here's how I open URL's from the command line. In ~/bin, I have a simple script
I named xurl. Thus, ~/bin/xurl is:

1 #!/bin/sh
2 cat <<. | /usr/bin/osascript
3 tell application "$1"
4 OpenURL "$2"
5 end tell
6 .

I can then type at the shell prompt:

% xurl mozilla http://www.macosxhints.com

or

% xurl "internet explorer" http://www.google.com

(I actually use this script primarily with the xchat IRC client
which allows you to right click on URL's and then choose items
from a customized menu - so I can select IE or Mozilla from that
pull down menu. If pine doesn't allow this flexibilty, then just
hardcode the browser in place of "$1" in the script and change $2
to $1).




[ Reply to This | # ]
opening URL's from the command line
Authored by: DAC on Apr 06, '02 01:56:08PM

I tried this a bit before I published my hints (the ones being commented on), and it does look like a cleaner solution. I may change my system over to match this one. But I had some trouble getting OmniWeb to take the script the same way as IE, so I have not moved over yet. I sometimes also use "odd " browsers that do not like this sort of script. Still, it is much cleaner than the one I made :).

DAC



[ Reply to This | # ]
Speed and Power...
Authored by: pmccann on Apr 05, '02 06:33:11AM





[ Reply to This | # ]
Nifty - A few problems/clarifications
Authored by: autohag on Apr 05, '02 10:20:51AM

Mac OS X Pine users of the world unite!
There must be, what, 3 of us now?

Comments;

1. The URL opening script - got it to work with Mozilla but could not
get it to work with Explorer no matter what I tried. Either Explorer would open
and do nothing or it simply wouldn't open. Tried specifying full path, creating
symbolic links, etc. Nothing worked. I mostly use Mozilla anyways.

2. The PrintPDF script - seems like a lot of work for simple printing but
what the hell, I did it. Took me forever to get it to work - here's why; In
the version of Pine I am using (4.4.3), the custom printer is called
"Personally selected print command". In order to get this to work, you first
supply a printer _name_ and THEN you supply the command. My mistake was supplying the command where the name should go. In other words, the name I selected was "PinePrinter" and then specified the Command as
/Applications/Toys/PinePrintPDF/PinePrint . Pretty nifty once I figured that out.

3. I have not messed with the mime thing. Don't really have a reason to.



[ Reply to This | # ]
Nifty - A few problems/clarifications
Authored by: DAC on Apr 06, '02 01:59:38PM

If you want IE for the OpenURL script, you may find that IE needs you to change one of its preferences for so that other applications requesting URL windows open up new windows. IE is just odd anyway. But it is the one I use most of the time for the OpenURL script, as the URLs I get sent in email are often so badly coded that only IE will open them.



[ Reply to This | # ]
Print from Pine scripts
Authored by: dawidlp on Feb 25, '03 03:45:23PM

Hi, I'm unable to access the iDisk in order to download those scripts I was wondering if anyone could send those to me. I would really appreciate this since I really need the print functionality in my pine program.

Thanks,
Dawid
dawid@mac.com



[ Reply to This | # ]
Author! Author!
Authored by: Anonymous on Apr 05, '02 12:28:43PM

I'm quite impressed. I'm a PINE user as well, and am greatly looking forward to returning home this evening and trying to implement these over the weekend. If they do, Mr. Cox, you've got my humblest and deepest thanks as a fellow PINE user. Any other incredible tricks of the trade you've got? Drop me an e-mail at mharris@enteract.com -- I'd love to pick your brain.



[ Reply to This | # ]
Why pine?
Authored by: baba on Apr 05, '02 06:04:08PM

I'm curious what the advantages of running Pine locally are, since for me the big advantage is keeping all my mail on a central server. The idea of using POP mail seems goofy to me, since I like to have all my mail -- new, sent, and otherwise -- accessible from any machine any time.
But if there were a way to run Pine locally, to take advantage of the goodies mentioned here, while keeping all the data remote, that would be sweet. It's amazing that with all the graphical goo-gaws out there nothing yet approaches Pine for clean functionality.



[ Reply to This | # ]
Why pine?
Authored by: DAC on Apr 06, '02 02:08:58PM

The great thing about running Pine localy is that it is just another email client. It can read mail on your local system if you want to set it up that way, but you don't need to.

Pine can read remote mail stores on both IMAP and POP servers. The configuration is a bit more complex, and usually not documented by your ISP, but with a bit of playing, you can usually get it to work. Pine will check multiple email accounts if you want it to, and can send email out as "different" people depending on who you want to be. It has all the features of all the GUI email programs you know about, but is fast and flexable.

Pine can store all of your mail (including sent-mail) in remote folders, just like a remote version of pine does. This depends on your ISP having all these folders on an avaliable IMAP server.

Running Pine localy lets you do great things like attach files without FTP, save files to your local directories, not have pauses when you are just trying to type, use transparency in the terminal, etc.

The only time I have found it is better to run Pine remotely is when you are doing searches on large folders of email (when the email is on the remote server). It is much faster for the remote version of pine to search remote folders, as it is "local" disk access to the process at that point.

Once you get pine set up to run localy, you will never look back.



[ Reply to This | # ]
Independent confirmation ...
Authored by: Anonymous on Apr 05, '02 11:28:04PM

Independent confirmation that all his suggestions seem to work admirably well and seem to be working fine on my system. It is glorious to be able to click on a file and have it come up in Preview, or to click on a URL and have Internet Explorer load it.



[ Reply to This | # ]
More About Using Pine?
Authored by: russh on Apr 06, '02 09:23:14PM

I have Pine installed, but I am having trouble figuring out the configuration. Ideally, I'd like to have it set up so that I can read all my mail from anywhere by ssh-ing into my OS X box.

I know how to ssh, I have pine installed, I have multiple email accounts, some pop, some imap.

Can pine handle this? Can someone point out how to do the configuration?

Thanks!



[ Reply to This | # ]
Jaguar has built-in command-line URL support
Authored by: cewatts on Feb 26, '03 03:57:42AM
There is a super-easy way to open URL's from the command line. It just goes straight to the default browser, but that's what I want 99% of the time.

In Jaguar, at least: set the url-viewer command within pine to be /usr/bin/open.

That's it. :-)

As for the mime-viewing stuff, I'm looking forward to being able to read it, but the idisk is down.

[ Reply to This | # ]