Is there a way to execute on applescript when a server becomes available?
You can use launchd for that purpose. Here is an example of a launchd config plist that will execute an AppleScript when a disk is mounted:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
    &lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;Example&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
            &lt;string&gt;/usr/bin/osascript&lt;/string&gt;
            &lt;string&gt;/Users/sakra/Documents/Test.applescript&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;StartOnMount&lt;/key&gt;
        &lt;true/&gt;
    &lt;/dict&gt;
&lt;/plist&gt;


To activate the config plist save it to the LaunchAgents folder in your Library folder as Example.plist.

From the Terminal you can then use the command launchctl to activate Example.plist by running:

launchctl load ~/Library/LaunchAgents/Example.plist


The AppleScript will then be run each time a filesystem is mounted.

To deactivate it, run:

launchctl unload ~/Library/LaunchAgents/Example.plist