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

[MacPerl] Passing variables from applescript to perl.



Hi,

I want to be able to plough through one of my mail boxes in eudora and pass
the body to a perl routine, as a variable.

I can see how to do the applescript bit (i.e. going through all messages
until the end of the mail box) but can't see how to assign things that
applescript returns to a perl variable.

For example:

--start--

$getNumOfMessages = <<END_SCRIPT;
	set mailbox_list to {"www-scripts daemon"} -- list of mailboxes to
transfer

	set num_lists to count mailbox_list
	repeat with list_num from 1 to num_lists by 1
		set mailbox_name to item list_num of mailbox_list
		tell application "Eudora Pro 3.1.1"
			count each message of mailbox mailbox_name
		end tell
		set message_count to the result
	end repeat

$num_messages = message_count;
END_SCRIPT

&MacPerl'DoAppleScript($getNumOfMessages);

print ("Num Messages ",$num_messages,"\n");

--end--

is a bit of perl I have that should set the perl variable $num_messages to
the number of messages in the mail box "www-scripts daemon", however it
doesn't work.
The last print statement prints nothing for $num_messages

Can anyone help as to how I should pass through variables.

Thanks

Peter Gradwell.


--
Peter at Gradwell dot com
mailto:Peter@Gradwell.com OR mailto:pjg7@aber.ac.uk

VISIT it NOW! - http://www.irds.org/peter/
NEW for the CLASSOF97 - http://www.loud-n-clear.com/gradwell/



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch