• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Responding to events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Responding to events


  • Subject: Re: Responding to events
  • From: Joshua See <email@hidden>
  • Date: Wed, 16 Apr 2003 20:44:36 -0500
  • Delivery-date: Wed, 16 Apr 2003 19:45:57 -0600
  • Envelope-to: email@hidden
  • Resent-date: Fri, 18 Apr 2003 12:48:16 -0400
  • Resent-from: email@hidden
  • Resent-message-id: <email@hidden l>
  • Resent-to: email@hidden

On Wednesday, Apr 16, 2003, at 14:59 US/Central, Lee Phillips wrote:
I found the thread, almost exactly one month old, and I finally got this to
work. Since you have to process the script each time you change it,
If by "process", you mean the ResEdit hacks, actually I don't. Smile will open and save the script while leaving its resource fork as is.

My script is just
on open location theurl
do shell script "source ~/.bashrc; handlemail " & theurl
end open location

on run
display dialog "I am intended to respond to mailto: links."
end run
For the on run handler I just put in a getURL for the webmail server. Thus, double clicking on the script will make it behave like a bookmark, a handy touch for my application.

Save the script as an application and open it in ResEdit (is there a way
to edit resource forks without starting Classic yet?).
I would have said "No, and don't expect one given that resource forks are essentially deprecated", but John Delacour has some interesting info on this.

As Joshua See said,
delete the BNDL and FREF resources, and modify the plst resource, A look at
that shows that it contains the creator and type codes, which you want to change
to arbitrary four-letter strings that are not being used by anything else. I
picked something strange and hoped for the best.
I used "Nuts" since this script is for use with SquirrelMail. Its a bad choice since its likely to be taken, but its not taken by anything currently in the labs this is intended for.

If you delete the plst resource
the script application gets turned into a Classic program, which is not what I
wanted.
I should also note that there is a aplt resource, containing only a single null character, in a script application. I haven't been able to figure out what it does. Removing the similar dplt resource from a droplet disables it, but changing or deleting the aplt seemingly does nothing.

My Python program checks that it has a mailto: link, extracts the address,
and beings a message with Mutt by sending a command to Terminal. It doesn't
look for encoded subjects, but could easily be made to do so. Let me know if
you want to see it.
Mine handles both subject and body specifications in the URL, but currently assumes they'll be in order of subject, then body. I've never seen them any other way, but my understanding is that the spec doesn't prohibit other arrangements. If you do add support for subjects defined in URLs, include a provision for ones that have not had spaces or other special characters escaped. They're prohibited by the spec but quite common, mostly due to MS HTML editors.

Let me know if you want to see it.
I'll also offer my script to those who ask.

Sincerely,
Joshua See
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Responding to events (From: Lee Phillips <email@hidden>)

  • Prev by Date: Re: Pref files
  • Next by Date: Re: Log progress to AS from "do shell script"
  • Previous by thread: Re: Responding to events
  • Next by thread: Re: mounting volumes using TCP/IP
  • Index(es):
    • Date
    • Thread