-
Notifications
You must be signed in to change notification settings - Fork 5
/
Enter Path.applescript
33 lines (32 loc) · 1021 Bytes
/
Enter Path.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
on open theFile
set filePath to POSIX path of theFile
tell application "LaunchBar"
hide
end tell
tell application "System Events"
set theApplication to application processes whose frontmost is true
set target to item 1 of theApplication
set target to a reference to front window of target
set target to a reference to front sheet of target
delay 1
tell target to keystroke "g" using {command down, shift down} -- Activate goto field
if ((count target's sheets) > 0) then set target to front sheet of target -- Open panels use a sheet
tell target
try
set value of text field 1 to filePath
try
click button "Go"
on error
click button "Aller"
end try
on error theError -- Carbon apps don't support setting the field directly, so type out the path.
set clipboardcontent to clipboard
set clipboard to filePath
keystroke "v" using command down
delay 0.1
keystroke return
set clipboard to clipboardcontent
end try
end tell
end tell
end open