forked from peterldowns/iterm2-finder-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetect_version.applescript
42 lines (37 loc) · 1005 Bytes
/
detect_version.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
on theSplit(theString, theDelimiter)
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to theDelimiter
set theArray to every text item of theString
set AppleScript's text item delimiters to oldDelimiters
return theArray
end theSplit
on IsModernVersion(version)
set myArray to my theSplit(version, ".")
set major to item 1 of myArray
set minor to item 2 of myArray
set veryMinor to item 3 of myArray
if major < 2 then
return false
end if
if major > 2 then
return true
end if
if minor < 9 then
return false
end if
if minor > 9 then
return true
end if
if veryMinor < 20140903 then
return false
end if
return true
end IsModernVersion
tell application "iTerm"
if my IsModernVersion(version) then
set modern to "true"
else
set modern to "false"
end if
end tell
do shell script "echo " & quoted form of modern