Hi all,
I’m expanding my vocabulary on Applescript and have recently started using handlers. I have one that works when run by itself, but when I put it in the main script, I get the following message:
Can’t make <> into type string.
and I’m trying to insert this directly after an if statement
global net_macinfo
set net_macinfo to MountBackupServer
MountBackupServer()
display dialog net_macinfo
on MountBackupServer()
set user_name to do shell script ("whoami")
set first_letter to do shell script ("whoami | cut -c1-1")
set backserver to do shell script ("mount | grep 'back-data' | cut -f5 -d/ | cut -f1 -d-")
if backserver is equal to "back" then
set dfsmount to do shell script ("mount | grep 'back-data' | cut -f1 -d\\( | cut -f8 -d/")
set net_primary to do shell script ("cat /Volumes/" & dfsmount & "/.macinfo | grep PRIMARY= | cut -f2 -d=")
set documents_exist to do shell script "ls /Volumes/" & dfsmount
end if
if backserver is not equal to "back" then
mount volume "cifs://office.ads.gvsu.edu/dfs/back-data-" & first_letter & "/" & user_name
set dfsmount to do shell script ("mount | grep 'back-data' | cut -f1 -d\\( | cut -f8 -d/")
end if
set net_macinfo to do shell script ("ls -al /Volumes/" & dfsmount & " | grep .macinfo| cut -f2 -d.")
set net_primary to do shell script ("cat /Volumes/" & dfsmount & "/.macinfo | grep PRIMARY= | cut -f2 -d=")
set documents_exist to do shell script "ls /Volumes/" & dfsmount
return net_macinfo
end MountBackupServer
Thank you for any help on this!