Skip to content

Commit

Permalink
I think NSAppleEventsUsageDescription fixed it
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtule committed Oct 9, 2019
1 parent 42b46e2 commit ac7136e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 2 additions & 0 deletions cd to .../cd to .../Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
<key>NSAppleEventsUsageDescription</key>
<string>Queries Finder and opens Terminal to it&apos;s location</string>
</dict>
</plist>
13 changes: 4 additions & 9 deletions cd to .../cd to .../cd_to____.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.scripting-targets</key>
<array>
<dict>
<key>com.apple.finder</key>
<array/>
<key>com.apple.terminal</key>
<array/>
</dict>
</array>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.finder</string>
</array>
</dict>
</plist>
8 changes: 3 additions & 5 deletions cd to .../cd to .../main.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main(int argc, const char * argv[]) {
FinderApplication* finder = [SBApplication applicationWithBundleIdentifier:@"com.apple.Finder"];

TerminalApplication* terminal = [SBApplication applicationWithBundleIdentifier:@"com.apple.Terminal"];

FinderItem *target = [(NSArray*)[[finder selection] get] firstObject];
if (target == nil){
target = [[[[finder FinderWindows] objectAtLocation:@0] target] get];
Expand All @@ -35,11 +35,9 @@ int main(int argc, const char * argv[]) {

NSURL* url = [NSURL URLWithString:fileUrl];

[terminal activate];

if (url == nil){
[terminal open:@[[NSURL fileURLWithPath:@"~/"]]];
} else{
if (url != nil){
[terminal activate];
[terminal open:@[url]];
}
}
Expand Down

0 comments on commit ac7136e

Please sign in to comment.