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

[MacPerl] Deleting files & interaction with AppleScript



Morning, all (or whenever it is where you are)

I've got two questions today. First, how do you have MacPerl delete a file? My
Perl for dummies suggests unlink, which doesn't seem to work. Do you just
rename it to the trash directory? And if so, do you rename it to the trash
directory on the volume it's on, or to your own trash?

Also, I've got the following as the last step in a MacPerl script:

&MacPerl'DoAppleScript(<<'END_SCRIPT');
tell application "Finder"
	activate
	select file "Fetch 3.0.3" of folder "Fetch 3.0.3 Folder" of folder
"Applications" of startup disk
	open selection
end tell
tell application "Fetch 3.0.3"
 	activate
 	make new transfer window at beginning with properties
{hostname:"lagrangenews.com", initial directory:"www"}
 	put into transfer window "lagrangenews.com" item alias "ADVERTISING 1:Publish:Classified:"
end tell
END_SCRIPT

I used the AppleScript record function to get the code, but when I run it from
MacPerl, a dialog pops up asking me where Fetch is - even though it's got the
exact path in proper AppleScript syntax.

And the really strange thing is that when I copy the AppleScript back out of
my MacPerl document, paste it into a new AppleScript window and try to run it,
AppleScript asks me where Fetch is - even though it has the proper path -
because the path was recorded in AppleScript initially. But AppleScript only
asks me the first time. After that it can find Fetch.

TIA for any and all light you can shed.

Ann

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