• 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: Extracting attachment from Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extracting attachment from Mail


  • Subject: Re: Extracting attachment from Mail
  • From: John Delacour <email@hidden>
  • Date: Wed, 5 Mar 2003 14:21:39 +0000
  • Mac-eudora-version: 6.0a9

At 11:13 pm -0800 4/3/03, Alan Kimelman wrote:

I have the same problem as Jeremy Sellors. I am unable to save an
attachment from mail.app using applescript. I did not understand John
Delacour's Perl script to parse the attachment.

do shell script "perl -e'
$f = q~" & f & "~ ;
open F, $f or die $! ;
while (<F>) {
\" parse the file line by line here \" ;
print ;
} '"

I tried it but did not succeed in saving or extracting the attachment.

In a similar vein, I was unable to follow Cricket's instructions to
tell Stuffit Deluxe to open or extract an attachment from the text file
made from the source of the message.


I don't understand why Stuffit won't do this without Mac line endings, but that seems to be the case. Surely Stuffit should accept any line ending -- besides I'm sure I had it working yesterday without changing the line endings.


set f to "" & (path to "desk") & "temp.txt"
tell application "Mail"
selection
first item of result
set s to source of result
end tell
(* Replace Mail's new lines with Mac line endings *)
set my text item delimiters to ASCII character 10
set ls to text items of s
set my text item delimiters to return
set s to ls as string
set my text item delimiters to ""
try
close access file f
end try
open for access file f with write permission
set eof file f to 0
write s to file f
close access file f
tell application "StuffIt Expander"
Expand {alias f} Destination (path to desktop)
end tell
_______________________________________________
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: 
 >Extracting attachment from Mail (From: Alan Kimelman <email@hidden>)

  • Prev by Date: Re: text item delimiters question
  • Next by Date: Recursive Find and Delete Droplet
  • Previous by thread: Extracting attachment from Mail
  • Next by thread: Re: Extracting attachment from Mail
  • Index(es):
    • Date
    • Thread