MacOS – Invoke Perl script in Windows from OS X

macosperlwindows

I have a Perl script written in Windows and an AppleScript written in OS X. I want the AppleScript to invoke the Perl script that is residing in Windows. How can I do this?

Best Answer

Assuming you have access to the file from your Mac system, for example through a shared folder, you would run it locally (through Terminal) like this:

perl /path/to/windows/shared/folder/scriptname.pl

In AppleScript this would be something like:

do shell script "/usr/bin/perl /path/to/windows/shared/folder/scriptname.pl

However, this still executes the Perl script from your local Mac instance. If you want to actually invoke it on the Windows server, that's a different ballgame. This would require you to setup remote access, through for example SSH or IIS on the Windows machine.