Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a simple AppleScript that works perfectly on two ML machines (10.8.3), but when I try to run it on a 10.7.5 machine it doesn't work. To make matters more confusing, in 10.7.5 it runs in the actual editor, but not when I run the application. Again, works fine in editor and as standard app in 10.8.

Here is my script:

set IP_Address to ""

tell application "Finder"


        set P_Result to (do shell script "ping -c 1 -q " & IP_Address)
        if "100% packet loss" is not in P_Result then

            mount volume "smb://" as user name "pcguest" with password "Abcd"
            mount volume "smb://" as user name "pcguest" with password "Abcd"
            mount volume "smb://" as user name "pcguest" with password "Abcd"
            mount volume "smb://" as user name "pcguest" with password "Abcd"

        end if
    end try
end tell

I have tried removing the tell application "Finder" and end tell but still no luck. I have also tried removing the section to ping server but again no luck. When I double click the app all that happens is that the AppleScript icon keeps jumping, whether I leave it for 5 seconds or 5 minutes. When I click on the icon in dock it disappears. On 10.8, my AppleScript icon appears for a second, mounts the volumes, and goes away.

The error I get when I run within AppleScript editor is a 10004 error but still mounts fine (the error only happens on 10.7 not 10.8).

This is driving me crazy - it's simple script to check to see if server is online. If it is, mount volumes. Simple.

How can I fix my script so that it does what I want it to do?

share|improve this question
If you saved it as an Application in 10.8, there could be small changes in the package that are causing problems on 10.7. Have you tried using AppleScript Editor to save it separately as a new application on 10.7? – robmathers May 19 '13 at 13:06
sometimes computers just confuse and frustrate me so much! i had actually resaved the file on 10.7 again but no luck. but your comment made me think. initially i had just uploaded the app to my dropbox and downloaded on target computer. so instead i put the file on a usb key and and copied it over to the 10.7 machine. and bam! worked no problems. thanks for the tip. – user49672 May 20 '13 at 8:41
@robmathers submit it as an answer, it solved the problem! – Shane Hsu May 21 '13 at 9:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.