Skip to content

Instantly share code, notes, and snippets.

@nariakiiwatani
Created April 4, 2018 01:03
Show Gist options
  • Save nariakiiwatani/2a1c9c5b851e74294170549d9b4f4395 to your computer and use it in GitHub Desktop.
Save nariakiiwatani/2a1c9c5b851e74294170549d9b4f4395 to your computer and use it in GitHub Desktop.
Open terminal at active item's location in Xcode. You can execute this script from Xcode by adding to "Preferences -> Behaviors".
#!/bin/bash
CURRENT_FILE_PATH=`osascript -e "tell application id \"com.apple.dt.Xcode\" to return path of document 1 whose name ends with (word -1 of (get name of window 1))"`
/usr/bin/open -a Terminal "$(/usr/bin/dirname $CURRENT_FILE_PATH)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment