Guest User

Untitled

a guest
Jan 23rd, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. set destinationdirectory to ((path to applications folder) & "Diablo II Folder") as string
  2. set modfilepath to ((path to desktop) & "Diablo2Backup:Mod:mod") as string
  3. set originalcopypath to ((path to desktop folder) & "Diablo2Backup:Original:Diablo II Patch (Carbon)") as string
  4. set modcopypath to ((path to desktop folder) & "Diablo2Backup:Mod:Diablo II Patch (Carbon)") as string
  5. set filepath to ((path to applications folder) & "Diablo II Folder:Diablo II Patch (Carbon)") as string
  6. tell application "Finder"
  7. try
  8. if exists file (destinationdirectory & ":mod") then
  9. display dialog "Mod file found. Replace with Original?" buttons {"yes", "no"}
  10. if button returned of result is "yes" then
  11. duplicate originalcopypath to destinationdirectory with replacing
  12. delete (destinationdirectory & ":mod")
  13. display dialog "Original file copy success" buttons {"yay"}
  14. else
  15. display dialog "File copy canceled" buttons {"damn"}
  16. end if
  17. else
  18. display dialog "Original file found. Replace with Mod?" buttons {"yes", "no"}
  19. if button returned of result is "yes" then
  20. duplicate modcopypath to destinationdirectory with replacing
  21. duplicate modfilepath to destinationdirectory
  22. display dialog "Mod file copy success" buttons {"yay"}
  23. else
  24. display dialog "File copy canceled" buttons {"damn"}
  25. end if
  26. end if
  27. on error errmsg
  28. display dialog "Error: " & errmsg
  29. end try
  30. end tell
Add Comment
Please, Sign In to add comment