-
Notifications
You must be signed in to change notification settings - Fork 134
/
Uninstall PhoneGap.applescript
51 lines (48 loc) · 1.7 KB
/
Uninstall PhoneGap.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- PhoneGap Uninstaller for Mac OS X
-- MIT Licensed
-- Copyright 2011 Nitobi Software Inc.
set question to display dialog "Uninstall PhoneGap?" buttons {"Yes", "No"} default button 2 with icon caution
set answer to button returned of question
if answer is equal to "Yes" then
tell application "Finder" to set home_path to home as text
tell application "Finder" to set startup_hd to startup disk as string
-- delete Xcode 3 Template
set source to (home_path & "Library:Application Support:Developer:Shared:Xcode:Project Templates:PhoneGap")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete Xcode 4 Template
set source to (home_path & "Library:Developer:Xcode:Templates:Project Templates:Application:PhoneGap-based Application.xctemplate")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete PhoneGapLib (used by Xcode 3 Template, and generating PhoneGap.framework if need be)
set source to (home_path & "Documents:PhoneGapLib")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete PhoneGap.framework (used by Xcode 4 Template) and its parent directories
set source to (startup_hd & "Users:Shared:PhoneGap")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete symlink to PhoneGap.framework
set source to (home_path & "Library:Frameworks:PhoneGap.framework")
tell application "Finder"
if exists file source then
delete source
end if
end tell
-- end
display dialog "PhoneGap uninstalled." buttons {"Goodbye ☹"} with icon note
else
display dialog "Phew!" buttons {"That was close ☺"} with icon note
end if