Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7291 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have been able to use applescript for FileMaker 10.2.8 and up to retrieve the NIC number from my Mac. However, I cannot get this to work properly with OS 9.2.2

I keep getting an error with the Write script: "FileMaker Developer got an

error: Unable to coerce the data to the desired type (error -1700)".

Does anyone have a simple Applescript that will allow me to grab the NIC number and save it into a field in FileMaker 6.0. I have found this script, I don't know if it could be edited to work.

In order to get the MAC Address from Apple System Profiler, you first need to know that ASP refers to this as the "AppleTalk Address", and that it returns the address in AppleScript's list format (ex: {"00.0a.27.d6.9d.06"}). Secondly, you need to know where ASP *is*, otherwise you'll get the dreaded "Please locate Apple System Profiler:" dialog box. I discovered that if you can let MC locate it (through whatever means you need - directories(), files(), etc.), you need to make sure that the default directory is set to the location of ASP, otherwise you'll get the "Please locate:" box.

On my Mac (and I believe most modern OS8-9 Macs), ASP is located in the Apple Menu Items folder. So here's the script (assuming MC has found it in the Apple Menu Items folder):)

function GetMACAddress

local tResult

set the directory to specialFolderPath("apple")

put "tell application" && quote & "Apple System Profiler" & quote & cr &

"get appletalk address" & cr & "end tell" into getMACScript

put "tell application" && quote & "Apple System Profiler" & quote & cr &

"close window" && quote & "Apple System Profiler" & quote & cr & "end tell" into quitASPScript

set the directory to specialFolderPath("apple")

do getMACScript as AppleScript

put the result into retVal

do quitASPScript as AppleScript

replace "{" with "" in retVal

replace "}" with "" in retVal

replace quote with "" in retVal

return retVal

end GetMACAddress

Note that although you can't send "quit" to ASP, you CAN say "close window 'Apple System Profiler'" and it does the same thing!

If anyone can fix this code, I would be extremely greatful! The main problem is also that you are required to browse to the apple system profiler.

I apprecitate any help I can get with this.

This topic is 7291 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.