• 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
Trying to pass file path from a.s. droplet to MacPerl code in the droplet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to pass file path from a.s. droplet to MacPerl code in the droplet


  • Subject: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
  • From: Matthew Galaher <email@hidden>
  • Date: Wed, 25 Jul 2001 09:08:37 -0700

Please forgive me if this has been covered.

I am trying to write an applescript droplet that passes the content of the
file dropped on it, to the MacPerl I've put in the a.s. droplet. This code
works when I have the path to the document as a string e.g. open(IN,
'Macintosh HD:Desktop Folder:my_doc.html') but does not work when I try and
use a variable. If this has something to do with @ARGV, might someone be
kind enough to write simple example? Any help would be much appreciated.
Thanks

on open file_list
set number_dropped to length of file_list
if number_dropped > 1 then
display dialog "Please drop one document at a time."
else
set file_path to item 1 of file_list as string
display dialog file_path

tell application "MacPerl"
activate

(Do Script "
open (IN, file_path) || die \"cannot open file\";
undef $/;
$file = <IN>;
print \"Your file contains.\\n\" . $file ;
")

end tell

end if
end open


  • Follow-Ups:
    • Re: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
      • From: rich allen <email@hidden>
  • Prev by Date: Re: Tree traversal
  • Next by Date: Moving man files gives out of memory error
  • Previous by thread: applescript + php + xml
  • Next by thread: Re: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
  • Index(es):
    • Date
    • Thread