-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNetBeans-Open.scpt
28 lines (17 loc) · 994 Bytes
/
NetBeans-Open.scpt
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
-- This AppleScript created by John Kramlich of http://www.johnkramlich.com
-- Modify it in anyway you see fit.
-- moded by bunam https://github.com/bunam/NetBeans-Open
return -- not needed, but shows that the script stops here when "run"
on open of finderObjects -- "open" handler triggered by drag'n'drop launches
set netBeansAppNameLastRev to do shell script "ls -1 /Applications/NetBeans/ | grep -e '^NetBeans' | sed 's/.app//g' | sort | tail -n 1"
set netBeansAppNameLastRev to netBeansAppNameLastRev & ".app"
set netBeansAppFullPath to "/Applications/NetBeans/" & netBeansAppNameLastRev & "/Contents/MacOS/netbeans"
set netBeansAppFullPathQuoted to quoted form of netBeansAppFullPath
repeat with i in (finderObjects) -- in case multiple objects dropped on applet
set mypath to POSIX path of i
do shell script netBeansAppFullPathQuoted & " --open " & quoted form of mypath
end repeat
tell application netBeansAppNameLastRev
activate
end tell
end open