Skip to content

Commit ac7136e

Browse files
committed
I think NSAppleEventsUsageDescription fixed it
1 parent 42b46e2 commit ac7136e

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

cd to .../cd to .../Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@
3030
<true/>
3131
<key>NSSupportsSuddenTermination</key>
3232
<true/>
33+
<key>NSAppleEventsUsageDescription</key>
34+
<string>Queries Finder and opens Terminal to it&apos;s location</string>
3335
</dict>
3436
</plist>

cd to .../cd to .../cd_to____.entitlements

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@
44
<dict>
55
<key>com.apple.security.automation.apple-events</key>
66
<true/>
7-
<key>com.apple.security.scripting-targets</key>
8-
<array>
9-
<dict>
10-
<key>com.apple.finder</key>
11-
<array/>
12-
<key>com.apple.terminal</key>
13-
<array/>
14-
</dict>
15-
</array>
7+
<key>com.apple.security.temporary-exception.apple-events</key>
8+
<array>
9+
<string>com.apple.finder</string>
10+
</array>
1611
</dict>
1712
</plist>

cd to .../cd to .../main.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int main(int argc, const char * argv[]) {
1818
FinderApplication* finder = [SBApplication applicationWithBundleIdentifier:@"com.apple.Finder"];
1919

2020
TerminalApplication* terminal = [SBApplication applicationWithBundleIdentifier:@"com.apple.Terminal"];
21-
21+
2222
FinderItem *target = [(NSArray*)[[finder selection] get] firstObject];
2323
if (target == nil){
2424
target = [[[[finder FinderWindows] objectAtLocation:@0] target] get];
@@ -35,11 +35,9 @@ int main(int argc, const char * argv[]) {
3535

3636
NSURL* url = [NSURL URLWithString:fileUrl];
3737

38-
[terminal activate];
3938

40-
if (url == nil){
41-
[terminal open:@[[NSURL fileURLWithPath:@"~/"]]];
42-
} else{
39+
if (url != nil){
40+
[terminal activate];
4341
[terminal open:@[url]];
4442
}
4543
}

0 commit comments

Comments
 (0)