GithubHelp home page GithubHelp logo

rkanter / open-iterm-or-terminal-here... Goto Github PK

View Code? Open in Web Editor NEW
132.0 132.0 17.0 9.44 MB

Generates an Applescript app that you can put in your Finder toolbar which will open an iTerm or Terminal tab at the current directory.

License: MIT License

AppleScript 58.52% Shell 41.48%
applescript finder finder-toolbar iterm2 mac terminal

open-iterm-or-terminal-here...'s People

Contributors

rkanter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

open-iterm-or-terminal-here...'s Issues

Finder on M1 problem...

Hi,

I also changed the script to open a new window instead of a new tab. It worked fined on my Intel MacBook Pro, but annoyingly I can't drag the app in the Finder toolbar on my Mac mini M1. Anyone have the same problem ? or even better, a solution ?

Thanks :)

Create a new window instead of a tab?

It would be nice to have the option to always create a new window instead of a new tab.

I changed the AppleScript slightly to allow this:

tell application "Finder"
	if (count of windows) > 0 then
		set thePath to target of front window
	else
		display dialog "There are no open Finder windows." with icon caution buttons {"OK"} with title "Open iTerm Here..."
		return
	end if
end tell

if not (exists thePath) then
	tell application "Finder" to set theName to name of front window
	display dialog "The location of the Finder window \"" & theName & "\" is not a real location (e.g. smart folder, search, network, trash, etc) and cannot opened in iTerm." with icon caution buttons {"OK"} with title "Open iTerm Here..."
	return
end if
set thePath to quoted form of POSIX path of (thePath as alias)

tell application "iTerm"
	-- Handles the case where iTerm is running but has no windows
	set createdWindow to false
	create window with default profile

	tell current session of current window
		write text "cd " & thePath & " && clear"
	end tell

	activate
end tell

And this works for me, but likely this should be packaged up as an option to the generation script...?

Create new windows if there aren’t any?

Thank you for this nifty little tool! I am quite pleased with it.

I noticed the following:

  • if iTerm is not open at all, the following error message is produced: image
  • if iTerm is open without a window, the new window will always open in the home directory
  • if an iTerm window is open, everything works as expected if an iTerm window exists

If I were to make a wish, I’d like those scenarios to be

  • open iTerm, and a new window in current directory
  • open a new window in current directory
  • open a new tab in current directory (already works).

How can I help?

FWIW – I am running this tool on macOS 10.15.3 (19D76).
Thanks!

macOS Big Sur

I've checked permits, it looks all good but I've that
"Not authorized to send Apple events to Finder.
Not authorized to send Apple events to Finder. (-1743)"

Icon

Not really an issue but I made an icon with the same style as others in the toolbar. If some are interested... I don't know where else to put it and too lazy right now to fork.

term.icns.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.