Appletalk address via Profiler/Applescript fails

Shari gypsyware at earthlink.net
Fri Jun 27 17:49:00 EDT 2003


The following fails on both Classic (8.6)  and OSX (10.2)

It spits up a "compiler error" error.   Both systems do have Apple 
System Profiler installed.  And using the shell() command to get the 
info in OSX works.

I tried "get the system profile" as well, and it returned "system profile"

Applescript does open and close the Profiler, so that much I know 
does work.  But it fails to get the data.


on mouseUp
   put macAdd() into it
   answer it
end mouseUp

function macAdd
       local retVal
       set the directory to specialFolderPath(Apple)
       put "tell application" && quote & "Apple System Profiler" & 
quote & return & \
           "get Appletalk address" & return & \
           "end tell" into getProfile
       put "tell application" && quote & "Apple System Profiler" & 
quote & return & \
           "close window" && quote & "Apple System Profiler" & quote & 
return & \
           "end tell" into closeProfile
       do getProfile as appleScript
       put the result into retVal
       do closeProfile as appleScript
       replace "{" with "" in retVal
       replace "}" with "" in retVal
       replace quote with "" in retVal
       return retVal
end macAddress
-- 
--Shareware Games for the Mac--
http://www.gypsyware.com



More information about the metacard mailing list