Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Script launches multiple Terminals w/ incorrect path' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script launches multiple Terminals w/ incorrect path
Authored by: vaag on Oct 31, '01 01:28:02PM

First, as demmer12 I have a Terminal alias in my Dock. The script is in ~/Library/Toolbar Scripts.
The description of demmer12 is almost exactly what happens over here, with one exception: pwd returns the parent directory of the one I'd selected, where ever I am!
Now, activating your OpenTerminalHereDebug-script, what happens is (after I'd selected my home directory) :
-a second Terminal icon opens in the Dock, the first one is not been activated yet;
-an alert box appears, text "map" [Dutch for "folder"] and cancel/ok;
-when I click ok, there's an alert sound, nothing happens;
-when I click the second Terminal icon in the Dock an alert box appears, text ":Users" and cancel/ok;
-when I click ok the first Terminal icon is been activated and two Terminal windows open, the ordinary one with the "Welcom to Darwin!" text and another with the window title "/Users/" and pwd of /Users So again, it returns the parent directory!



[ Reply to This | # ]
Script launches multiple Terminals w/ incorrect path
Authored by: liyanage on Oct 31, '01 06:30:10PM

Ahh, I think we have a misunderstanding here:

1.) You cannot *select* something and then click the toolbar script icon to open
a terminal window inside the selected object. A click on the icon always opens a
shell in the window that *contains the button* in its toolbar, *not* in the selected folder.
What you want can be accomplished by dropping the item in question onto the toolbar script icon.

2.) The "second" Terminal icon you're seeing in the dock is actually the AppleScript application launching. It will in turn launch the real Terminal application and then terminate itself.
The big problem here is that I just "borrowed" the original icon of the Terminal app, which
is very confusing because it looks like there are two Terminal applications running. I will change the icon ASAP.

3.) the Terminal application has the habit of opening a new terminal window whenever it is being
launched or sometimes when it's being brought to the front. This is probably why you're seeing two new terminal windows pop up. One is opened by the Terminal application after it's launched, the other one is the one you want, the one that was created by the AppleScript application.



[ Reply to This | # ]
Working
Authored by: demmer12 on Oct 31, '01 08:28:21PM

Now that we understand each other, all is well. Many thanks!!!

I'm usually good at considering most possibilities, such as the
script being the "other" Terminal bouncing in the Dock, but that
one went right on by. I agree that the script icon should be
changed, but keep a Terminal theme if you can, like putting a
small script image atop the terminal.

Thanks again!



[ Reply to This | # ]
Script launches multiple Terminals w/ incorrect path
Authored by: nagani on Oct 31, '01 09:07:25PM

You can avoid the double terminal windows:

In Terminal Preferences/Startup, select "Do nothing" rather than "Open a new window". Terminal will not open a new window when you launch it from the Finder, but it will if you click its icon in the Dock... (isn't this behavior close to a bug?) I use(d) Snard to launch Terminal with this preference, and it also opens a new window.

Thanks Marc for this script! This and the <tt>open .</tt> hint do impress my colleagues!



[ Reply to This | # ]
Script launches multiple Terminals w/ incorrect path
Authored by: vaag on Nov 01, '01 06:07:45PM

>1.) You cannot *select* something and then click the toolbar script icon to open
>a terminal window inside the selected object. A click on the icon always opens a
>shell in the window that *contains the button* in its toolbar, *not* in the selected folder.
>What you want can be accomplished by dropping the item in question onto the toolbar script icon.

Frankly, selecting an item and clicking the toolbar script icon gives me the same terminal window result as dropping the item onto the toolbar script icon.
Also, in practice, I often open a terminal window and change directory by typing cd and dropping the folder I want to cd to in the terminal. It would be nice if you could simply select this folder in the finder and then click onto the toolbar script icon to get the same result (instead of cd to the parent directory).
But then I think, it's just simply getting used to it.
Thank you,
Vincent



[ Reply to This | # ]