New in 1.4.2: "Visor via AppleScript" -- but how?!

Hi internet,

So prior to updating to 1.4.4 (honestly I’m not sure what version I was using!) i could do the following:

tell application "Terminal"
activate
end tell

tell application "System Events"
tell application process "Terminal"
keystroke “t” using command down
end tell
end tell

which would open me a new tab in my open, hidden Visor, after which I could run whatever I wanted there.

Now, this same script, that was working before, opens a new Terminal window instead.

The changelog for 1.4.2 says that “Added support for showing Visor via AppleScript.” was added – does anyone know how this is implemeted / what this feature does?!

Forgive the n00b question, but… is there any documentation for TT’s features…?!

Thanks!!

Hi, I’m sorry for breaking existing functionality. This was some change added by @brian and I don’t exactly understand what it solved.

Anyway I just tried your usecase and your script can be modified, this is what works for me on my 10.8.5 system:

tell application "Terminal"
    activate
    tell application "System Events" to keystroke "§" using control down
    tell application "System Events" to keystroke "t" using command down
end tell

First you have to bring Visor down using your keyboard shortcut and then you can create a new tab.

Hi Darwin,

Thanks, that works!
Much appreciated!

Hayim.


Two small issues though, which might be illuminating:

1 - When I press command-t to open a new tab while a visor window is open, it creates a new visor shell of the same default height, not including the tabs list – ie, if there is only 1 tab open, it lengthens the window height by 1 line in order to include the tabs.

When I tell System Events to do command-t, it creates a new tab and then shortens the shell height by 1 line, so that the window is still the same size as it was when there was only 1 tab. If I open and close new tabs this way, I can shrink the visor window down to 1 line!

Any ideas why there is a difference?

2 - When I tell Terminal to activate via script, nothing further happens than simply making Terminal the active program and bringing any open windows to the front. On the other hand, if I click the Terminal icon in the dock, Terminal activates and brings down the Visor (if no regular windows are open, and Terminal is not currently active).

Any ideas what is called when you click the dock icon which isn’t called by telling Terminal to activate?

I’m sorry to report that this change also broke compatibility with Shuttle (Shuttle is a menubar app that allows you to launch terminal using shortcuts). Shuttle does use applescript to launch terminal, but unfortunately it’s compiled in so there’s no way to customize the script(s). Well, other than forking and recompiling :smile: It seems like it would be a pain for him to fix since the TT keyboard shortcut is configurable. Any suggestions?

Thanks for a great app. I really appreciate your efforts.

My changes apparently have some unexpected consequences so I’ve disabled this feature by default. This sample script demonstrates how I intended this feature to work.
Since 1.4.5, running defaults write com.apple.Terminal TotalTerminalVisorExposeFrontmostAndVisibleProperties -bool YES will enable the functionality.

Let me know if the latest TotalTerminal still has this issue.

First of all, thank you for responding so quickly. On a Sunday. Supporting freeware.

After doing a bunch of experiments yesterday, I’m wondering if the issue is actually Mavericks and not any change you made. I tried rolling back to 1.4.4 and 1.4.2 and the behavior is actually the same:
When Visor is down, Shuttle works as expected, adding a new tab and issuing its command.
When Visor is up, a new un-visored Terminal window is spawned instead.

Unfortunately, I’ve upgraded all of my machines to Mavericks, so I can’t test any pre-Mavericks configurations.

As it stands, now that I’ve been able to better characterize the behavior, it’s a usable (albeit imperfect) system, and I’ll be able to work with it even if this never gets fixed.

For reference, here is the AppleScript Shuttle is using.

I’m not an objective-c or AppleScript guy, so this is just a guess, but it seems like the issue could be that the activate AppleScript command is making it frontmost but is not displaying Visor.

I’ve cloned the Shuttle repo and would be happy to run any tests or try any experiments that might help. It turns out that making the TotalTerminal keyboard shortcut configurable in Shuttle is quite simple, so a fix could be just a matter of being able to tell (from AppleScript) when Visor is down or up, so that Shuttle knows when to send the keystroke.

Hi TT!

Firstly thanks so much to Darwin and the whole team for this fantastic and, yes, free app. It brings joy to my UE :slight_smile:

I just updated to 1.6 and everything is perfect.

  • The weird resizing issue is fixed!
  • And I love the option to have visor auto-slide on activation of Terminal (both via dock and by telling it in applescript!) – and it doesn’t activate unless there are no other terminal windows open – genius.

I think the balance struck between visors and windows is really appropriate and intuitive, and that’s really what makes TT the best slide down console app around.

Thanks!!

P.S I looked for a donation button to support TT, but didn’t see one. Perhaps it’s a labour of love… in which case I’ll send that donation on to a charity in TT’s honour!

Thanks! We are happy you are happy.

If you want to support our efforts, you may consider sending some fractions of bitcoin to this address 1AUh9BCpzuDQyfthaRwaUYvhhmhRDSB3Aq.