• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
newbie applescript questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

newbie applescript questions


  • Subject: newbie applescript questions
  • From: Michael Malchiodi <email@hidden>
  • Date: Fri, 22 Mar 2002 09:32:30 -0500

I am relatively new to applescript. I have a few questions and would appreciate any help you could give me.
How can I tell via a script if I am running the classic environment on OS10. I have a script that needs to work on OS10 down to 8.5 and therefore need to call different sets of code based on the os.

------------------------------------------------- First Question Start------------------------------------------
--- os 10 call to get the ethernet card's address
Tell Apple System Profiler
set return to item 3 of item 1 of (network info of(get network info))
End tell

-- os 9 call to get the ethernet card's address
Tell Apple System Profiler
get Appletalk address of properties
end tell

My problem arises when the script executes on a OS 10 machine running the classic environment.
The call will hit the OS 9 section and miss the intended OS 10 section. I would rather have it hit the
OS 10 section because there is no way to guarantee the user's machine is configured (correctly) to
launch the classic environment. Is there any way to force the machine to utilize the osx environment and not launch classic. I can not save two versions of the script it must be one for all os.
----------------------------------------------------First Question End --------------------------------------

--------------------------------------------------Second Question Start------------------------------
Does anyone know if the Apple System Profiler call to get Appletalk address of properties
will return the true etherenet card's address (card physically in the machine and not a software version like PHP etc.) or all of the ethernet card addresses concatenated if you have more than one.
My os 9 box only has 1 ethernet card, the same code running on classic on os10 produces a string that is concatenation of all the addresses. I wonder if the os 9 box had more than 1 ethernet card would it produce the same situation.
------------------------------------------------Second Question End-------------------------------------

-----------------------------------------------Third Question Start--------------------------
I have a script that is downloaded from our intranet site. The script contains a call to delete itself while it is running. The script is saved as a classic application. On os 9 this runs fine. On os 10 running the classic environment the script errors out saving can not move to trash folder while the script is still open.
Any ideas how to delete a script while it is running. By doing this the script is still in memory executing the commands and the same script deletes itself off the users machine. I have tested the code by putting the delete statement on the first line, it still works fine. What about 10?
---------------------------------------------- Third Question End
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: Is the picture_folder of the screensaver in OS X scriptable?
  • Next by Date: Scripting TimeCode Track in QTplayer
  • Previous by thread: Re: FileMaker Scripting Query
  • Next by thread: Scripting TimeCode Track in QTplayer
  • Index(es):
    • Date
    • Thread