home *** CD-ROM | disk | FTP | other *** search
/ How to Get Online 1996 Spring / HOW2GON.ISO / mac / TCP / pppPrefFix / pppPrefFixScript < prev    next >
Encoding:
Text File  |  1995-06-25  |  3.5 KB  |  97 lines  |  [TEXT/ttxt]

  1. --"pppPrefFix"       
  2. --v1.0.4
  3. --By Michael D Mays
  4. --June 24,1995
  5. --Copyright ©1995 by Michael D Mays    
  6. --mdmays@iadfw.net
  7. --76447.67@compuserve.com     
  8. --
  9. --I saved the script this way so that the run-only application and script would not be confused
  10. --
  11. property finderLibraryAlias : ""
  12. path to system folder as string
  13. copy result to sysFolder
  14. copy result & "System" to pathName
  15. get short version of (info for alias ((path to system folder as string) & "System"))
  16. set togExtension to result as number
  17. path to preferences folder as string
  18. copy result to prefFolder
  19. copy prefFolder & "PPP Preferences" to pppPref
  20. copy prefFolder & "PPP Preferences Copy" to pppPrefCopy
  21. if togExtension ≥ 7.5 then
  22.     tell application "Finder"
  23.         get path to extensions folder as string
  24.         set finderScriptExtenRef to a reference to file (result & "Finder Scripting Extension")
  25.         if not (finderScriptExtenRef exists) then
  26.             display dialog ¬
  27.                 "You need to place the extension \"Finder Scripting Extension\" in your \"Extension Folder\" in your \"System Folder\" on your startup disk to use this script.
  28.  
  29. Please place it there and Restart your computer." buttons {"Cancel"} default button "Cancel"
  30.         end if
  31.         try
  32.             select alias pppPref
  33.         on error errMsg number errNum
  34.             if errNum = -1728 then
  35.                 beep
  36.                 display dialog "You need to run MacPPP at least once before running this script. If you have something is wrong with your MacPPP. (It's not creating a preference file called 'PPP Preferences' in the 'Preference Folder' of your 'System Folder' on your startup disk.)" buttons {"Cancel"} default button "Cancel"
  37.             else
  38.                 display dialog "Ooops...  Something went wrong which I wasn't expecting. " & ¬
  39.                     "Please eMail me and include this very important code:
  40.                 
  41. " & togExtension & "." & errNum buttons ¬
  42.                     {"Click for email address"} default button "Click for email addresses"
  43.                 display dialog "mdmays@iadfw.net
  44.             -or-
  45. 76447.67@compuserve.com
  46. Please don't forget to include this code:
  47.  
  48. " & togExtension & "." & errNum & "
  49.  
  50. Thanks!" buttons {"Cancel"} default button "Cancel"
  51.             end if
  52.         end try
  53.         duplicate selection
  54.         move alias pppPref to trash
  55.         select alias pppPrefCopy
  56.         set name of selection to "PPP Preferences"
  57.     end tell
  58. else
  59.     repeat
  60.         try
  61.             set finderLib to load script finderLibraryAlias
  62.             exit repeat
  63.         on error
  64.             set finderLibraryAlias to (choose file with prompt ¬
  65.                 "Please locate the runtime library \"FinderLib\"." of type "osas")
  66.         end try
  67.     end repeat
  68.     tell finderLib
  69.         try
  70.             display dialog pppPref & "
  71.         " & sysFolder
  72.             copyFiles from pppPref to sysFolder without warning
  73.         on error errMsg number errNum
  74.             if errNum = -1728 then
  75.                 beep
  76.                 display dialog "You need to run MacPPP at least once before running this script. If you have something is wrong with your MacPPP. (It's not creating a preference file called 'PPP Preferences' in the 'Preference Folder' of your 'System Folder' on your startup disk.)" buttons {"Cancel"} default button "Cancel"
  77.             else
  78.                 display dialog "Ooops...  Something went wrong which I wasn't expecting. " & ¬
  79.                     "Please eMail me and include this very important code:
  80.                 
  81. " & togExtension & "." & errNum buttons ¬
  82.                     {"Click for email addresses"} default button "Click for email addresses"
  83.                 display dialog "mdmays@iadfw.net
  84.             -or-
  85. 76447.67@compuserve.com
  86. Please don't forget to include this code:
  87.  
  88. " & togExtension & "." & errNum & "
  89.  
  90. Thanks!" buttons {"Cancel"} default button "Cancel"
  91.             end if
  92.         end try
  93.         moveFilesToTrash at pppPref
  94.         moveFiles from sysFolder & "PPP Preferences" to prefFolder without warning
  95.     end tell
  96. end if
  97.