News for hackers. Stuff that matters.
Re:Ask HN: What do you automate in your workflow? by tanin on Friday June 10, 2022 @11:32PM (#31701679)
My time to shine.

I have built a programmable tooltip for Mac. It works on any app. I use this hundreds of times a day at work for 2y now.

You can select any text and activate the tooltip with the short key. Then, the tooltip offers a list of options like jumping to URL, showing some extra info.

You are the one who write the script to process the text and return the options.

You can check it out here: github.com/tanin47/tip

PS. I configure a mouse button to trigger the Tip short key, so it is even more convenient.

Re:Ask HN: What do you automate in your workflow? by al_borland on Saturday June 11, 2022 @12:33AM (#31701951)
This is pretty interesting. When I was using Windows at work I made something like this with AutoHotKey. I’d highlight text, hit a button on my mouse, it would load that text into a GUI and give me a dozen options for what I wanted to do with it. Some options were basic, just appending it to a URL to do a search, while others were more involved, requiring some config setup in the GUI to open something in a native app. It was fantastic, and many people on my team started using it.

Since I moved to macOS at work all of that went away and I haven’t been able to find a good alternative to AutoHotKey for macOS. Although it’s hard to know if I can even attempt to run this at work with how locked down things have become.

Re:Ask HN: What do you automate in your workflow? by tanin on Saturday June 11, 2022 @02:10AM (#31702366)
> Although it’s hard to know if I can even attempt to run this at work with how locked down things have become.

If it helps, Tip runs in App Sandbox without requesting any additional permission.

This means Tip cannot read any file on your computer (other than the predefined places in its own sandbox) nor anything on other apps.

There are 2 limited things that it can do:

1. It can only execute the script that you provide at ~/Library/Application\ Scripts/tanin.tip/provider.script

2. It can only see the string that you activate Tip on. This is through NSService.

The privacy and security is top notch. Kudos to Apple who provides such good frameworks.

You can try requesting the app to be allowed from your IT team. I did this at my company (i.e. Stripe) as well.

Re:Ask HN: What do you automate in your workflow? by al_borland on Saturday June 11, 2022 @05:00PM (#31708347)
Are you planning to compile this for Apple Silicon? I've been trying hard to avoid installing Rosetta on my new MBP (not that I've heard anything bad, I just don't want to even have to think about it when they finally drop support).
Re:Ask HN: What do you automate in your workflow? by tanin on Saturday June 11, 2022 @05:10PM (#31708442)
It should work with M1.

I just got M1 last week, and it works.

Please let me know if it doesn't.

Re:Ask HN: What do you automate in your workflow? by al_borland on Saturday June 11, 2022 @05:16PM (#31708504)
It probably works, but it prompts me to install Rosetta, so I clicked cancel, as I've been trying to avoid that on principle. I'm not sure what principle exactly...

Obviously I'm not expecting you to go out of your way, but was wondering if you had plans for native support.

Re:Ask HN: What do you automate in your workflow? by tanin on Saturday June 11, 2022 @07:22PM (#31709446)
Maybe my work laptop has Rosetta by default.

I do have plan to compile a native one. I will see when I can recompile it on M1. Thank you for letting me know.

Re:Ask HN: What do you automate in your workflow? by al_borland on Saturday June 11, 2022 @11:01AM (#31704918)
Thanks. I'll look into it and see how it goes.
Re:Ask HN: What do you automate in your workflow? by slightwinder on Saturday June 11, 2022 @07:32AM (#31703712)
That's pretty cool. I wish linux had such abilities. I have a similar app-specific launcher to call scripts, but the best I can use are keys, so I just fire ctrl-c or such, wait some seconds and have something useable in a separate dialog. Such an integrated tooltip seems to be far better than this.

Thinking about, MacOS has a long history of well integrated automation, with AppleScript, external callable function per window/app and they even had automator at some point. Not sure what happened to it. Linux had something similar with KDE and dcop, but it died at some point.

Re:Ask HN: What do you automate in your workflow? by tanin on Saturday June 11, 2022 @02:43PM (#31706987)
I agree. I was thinking about building it for linux, but there's no equivalent mechanism. I was thinking about utilizing clipboard instead.

Apart from that, AppSandbox + NSUserUnixTask + NSService reallt enable this use case to have the highest privacy level. Without these 3, I would have had to request pervasive permissions on user's machine.

Re:Ask HN: What do you automate in your workflow? by coisale13 on Saturday June 11, 2022 @03:27AM (#31702672)
I'm very interested that you can open Intellij code. Do you have example code from your GIF you could link?

Is Intellij opened with the type url or a script?

Can't wait to use this! Thanks

Re:Ask HN: What do you automate in your workflow? by tanin on Saturday June 11, 2022 @04:23AM (#31702867)
Yes. You can open the below URL:

idea://open?file=/home/user/file/path.scala&line=56

VSCode has one too

vscode://file/home/user/file/path.js:56