applescript worlks fine in 10.8 but not in 10.7
hi 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 doesnt work. to make matters more confusing, in 10.7.5 it runs in the actial 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 "192.168.0.8"
tell application "Finder"
try
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://192.168.0.8/Disk1" as user name "pcguest" with password "Abcd"
mount volume "smb://192.168.0.8/Disk2" as user name "pcguest" with password "Abcd"
mount volume "smb://192.168.0.8/Disk3" as user name "pcguest" with password "Abcd"
mount volume "smb://192.168.0.8/Disk4" 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. 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, whethet 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 appers for a second, mounts the volumes, and goes away.
the error i get when i use run within applescript editor is a 10004 error but still mounts fine. (again error only happens on 10.7 not 10.8.
this is drivinf me crazy its simple script check to see if server is online. if it os, mount volumes. simple.
please help me sort this out.
hi 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 doesnt work. to make matters more confusing, in 10.7.5 it runs in the actial 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 "192.168.0.8"
tell application "Finder"
try
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://192.168.0.8/Disk1" as user name "pcguest" with password "Abcd"
mount volume "smb://192.168.0.8/Disk2" as user name "pcguest" with password "Abcd"
mount volume "smb://192.168.0.8/Disk3" as user name "pcguest" with password "Abcd"
mount volume "smb://192.168.0.8/Disk4" 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. 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, whethet 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 appers for a second, mounts the volumes, and goes away.
the error i get when i use run within applescript editor is a 10004 error but still mounts fine. (again error only happens on 10.7 not 10.8.
this is drivinf me crazy its simple script check to see if server is online. if it os, mount volumes. simple.
please help me sort this out.
No comments:
Post a Comment