• 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: 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]

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


  • Subject: Re: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
  • From: rich allen <email@hidden>
  • Date: Wed, 25 Jul 2001 08:21:01 -0800

on UsePerl(aFile)
tell app "MacPerl"
do script [ "
open (IN, $ARGV[0]);
", aFile as string]
end tell
end UsePerl

- hcir

On Wednesday, July 25, 2001, at 08:08 AM, Matthew Galaher wrote:

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
____________


References: 
 >Trying to pass file path from a.s. droplet to MacPerl code in the droplet (From: Matthew Galaher <email@hidden>)

  • Prev by Date: Moving man files gives out of memory error
  • Next by Date: Alternate download location for XCMD OSAX?
  • Previous by thread: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
  • Next by thread: Moving man files gives out of memory error
  • Index(es):
    • Date
    • Thread