[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Passing variables back and forth to AppleScript?



I'm a newbie on this list. Please don't burn me too badly if you've already
covered this adnauseum :)

I've been scripting Perl for a little while, and MacPerl for only a couple of
weeks. I'm trying to use MacPerl and AppleScript together to automate some of
my routine tasks.

What I'd like to do is use an AppleScript dialog box to choose a file/folder
and MacPerl to deal with the files.

How do I pass the value back and forth to MacPerl? Or can it all be done
(easily) in MacPerl?

I plan to insert the following into Perl via "do AppleScript"

---------------------------
tell application "Finder"
	activate
	set theFolder to choose folder
		with prompt "Find the folder containing today's obits (on Advertising)"
	select {file "095.html" of theFolder, folder "amp_graphics" of theFolder}
	copy selection to folder "Obits" of folder " Pages" of folder " WWeb Stuff"
of disk "Admin Volume"
end tell
---------------------------

Then Perl would pick up the name of "theFolder", which will be formatted
something like: "garbage_month-day-year-moregarbage" and rename the file
095.html to monthday.html, and then fiddle with the contents of the file.


Thanks,
G. Ann
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for G. Ann Campbell
Content-Disposition: attachment; filename="vcard.vcf"

Attachment converted: macnas:vcard.vcf 1 (TEXT/R*ch) (000151E1)