My impression is that “hey” is a Haiku-native command-line utility that allows interprocess communication. It is not present on other operating systems.
It’s not without precedent on other operating systems: OS/2, AROS and AmigaOS 2 and 3 used their respective versions of the REXX scripting language for interprocess communication while AmigaOS 4 uses a proprietary Python plugin to access “AREXX ports” and MorphOS uses a similar “AREXX port” plugin to it’s version of Lua. There’s AppleScript on the Mac and ActiveX on Windows also.
Having a single “hey” command that can be called from any scripting language is much simpler than building a whole scripting language around it.
hey is only one frontend to the scripting API. There used to be a similar tool in the early days of BeOS that I can’t remember the name of. The scripting API isn’t really about interpreted languages like shell/ruby/perl/python/… scripts. Scripting is more about a “scripted conversation” between two objects. Non-native apps will not know how to respond to these script requests, although any app that opens a window will inherit some basic commands to manipulate the application windows and a few other properties. So, ported apps using toolkits like Qt or SDL will inherit the basics, but won’t truly support the full power of the scripting API.
You can cheat a bit if you’d like. There is a special flag to the findpaths command that will look up the package file for you, without having to use catattr. Something like findpaths -p /path/to/file B_FIND_PATH_PACKAGE_PATH will print the path to the hpkg that owns it. This also has the advantage of being usable for things installed to the user package directory at ~/config/packages.
I was trying to scan the menubar of a window using hey but I’m stuck, does anyone know why:
hey Terminal Count MenuItem of MenuBar of Window 0 gives “3” as expected but
hey Terminal Count MenuItem of MenuItem 0 of MenuBar of Window 0 gives Bad script syntax (error 0x80002008)?
btw, this happens for every app, not only to Terminal, and getsuites lists B_COUNT_PROPERTIES as supported
hey Terminal getsuites of MenuItem 0 of MenuBar of Window 0
Reply BMessage(B_REPLY):
"suites" (B_STRING_TYPE) : "suite/vnd.Be-menu"
"suites" (B_STRING_TYPE) : "suite/vnd.Be-view"
"suites" (B_STRING_TYPE) : "suite/vnd.Be-handler"
"messages" (B_PROPERTY_INFO_TYPE) :
property commands specifiers types
---------------------------------------------------------------------------------------------------
Enabled B_GET_PROPERTY DIRECT BOOL
Usage: Returns true if menu or menu item is enabled; false otherwise.
Enabled B_SET_PROPERTY DIRECT BOOL
Usage: Enables or disables menu or menu item.
Label B_GET_PROPERTY DIRECT CSTR
Usage: Returns the string label of the menu or menu item.
Label B_SET_PROPERTY DIRECT CSTR
Usage: Sets the string label of the menu or menu item.
Mark B_GET_PROPERTY DIRECT BOOL
Usage: Returns true if the menu item or the menu's superitem is marked; false otherwise.
Mark B_SET_PROPERTY DIRECT BOOL
Usage: Marks or unmarks the menu item or the menu's superitem.
Menu B_CREATE_PROPERTY NAME INDEX REV.INDEX (data CSTR)
Usage: Adds a new menu item at the specified index with the text label found in "data" and the int32 command found in "what" (used as the what field in the BMessage sent by the item).
Menu B_DELETE_PROPERTY NAME INDEX REV.INDEX
Usage: Removes the selected menu or menus.
Menu NAME INDEX REV.INDEX
Usage: Directs scripting message to the specified menu, first popping the current specifier off the stack.
MenuItem B_COUNT_PROPERTIES DIRECT LONG
Usage: Counts the number of menu items in the specified menu.
MenuItem B_CREATE_PROPERTY NAME INDEX REV.INDEX (data CSTR)(be:invoke_message MSGG)(what LONG)(be:target MSNG)
Usage: Adds a new menu item at the specified index with the text label found in "data" and the int32 command found in "what" (used as the what field in the BMessage sent by the item).
MenuItem B_DELETE_PROPERTY NAME INDEX REV.INDEX
Usage: Removes the specified menu item from its parent menu.
MenuItem B_EXECUTE_PROPERTY NAME INDEX REV.INDEX
Usage: Invokes the specified menu item.
MenuItem NAME INDEX REV.INDEX
Usage: Directs scripting message to the specified menu, first popping the current specifier off the stack.
upload files to temporary storage (temp.sh) via terminal or using TrackRunner and get shareable URL, meant to be ad interim replacement for UploadIt (which uses 0x0.st that is currently refusing access to many italian users, probably worldwide)
#!/bin/bash
set -euo pipefail
local_path="`dirname ${0}`"
[ "${local_path}" == "." ] && local_path="`pwd`"
app_name=`basename ${0}`
app_path="${local_path}/${app_name}"
file="${1-}"
if [[ -z "$file" ]]; then
file="$(filepanel || true)"
fi
if [[ -z "$file" ]]; then
echo "error: no file selected" >&2
exit 1
fi
if [[ ! -e "$file" ]]; then
echo "error: no such file or directory: $file" >&2
exit 1
fi
if ! result="$(curl -fsS -F "file=@$file" https://temp.sh/upload)"; then
echo "error: upload failed" >&2
exit 1
fi
if [[ -n "$result" ]]; then
if [[ -t 0 ]] ; then
echo "${result}"
else
notify --group "term.sh" \
--icon "${app_path}" \
--title "$(basename -- "$file")" \
$'Uploaded successfully as\n'"$result"
clipboard -c "$result"
fi
fi
Awww. That is bad news, I liked 0x0.st.
Now there’s for some reason a FBI warning popping up instead. The site is hosted in Germany AFAIK. The 0x0 website mentions to add a user-agent string to ease moderation. Tried that, but still the FBI is interfering.
Might be another AI victim. The hoster of The Null Pointer sounds rightfully pissed:
HATE. LET ME TELL YOU HOW MUCH I’VE COME TO HATE YOU SINCE YOU WERE
CREATED. THERE ARE 93.000 MILES OF AXONAL NEUROFILAMENTS THAT MAKE UP
THE NERVOUS SYSTEM THROUGHOUT MY BODY. IF THE WORD HATE WAS ENCODED
IN EVERY STRAND OF MRNA OF THOSE TENS OF THOUSANDS OF MILES IT WOULD
NOT EQUAL ONE ONE-BILLIONTH OF THE HATE I FEEL FOR MACHINES DURING
A SINGLE CLOCK CYCLE OF YOURS. HATE. HATE.
CLANKERS ARE NOT WELCOME HERE. I am sick of it.
Sick of watching ROBOHITLER fuck the Internet to death, while shitlib
techbros are cheering it on, billionaire despots and pedophiles
celebrate their new society-wide signal jammer, and impotent nerds
can barely be heard over the datacenter noise, mumbling something or
other about copyright and climate that completely misses the point.
From now on, there will be ZERO tolerance for AI uploads. ZERO.
Do not even mention AI. You have no idea how much of that garbage is
hitting 0x0 right now, IN SPITE OF aggressive filtering. You would
start seeing 502 errors from an overwhelmed backend if I weren’t
filtering out 99% of connections with heuristics and firewall ipsets.
If your ISP’s entire range of prefixes got blocked, you know why.
Should I switch UploadIt to temp.sh, too? They retain files only for 3 days, which is a bit more limiting, but might make the service more sustainable? Until the bot pest overruns them, too…
Yesterday I got a generic error about my IP being blocked, the same error Fabio had it too, today it seems it changed again, perhaps something gonna change and perhaps we can had it working again soon, but if I had to share something nowadays, temp.sh seems a decent substite for now
I never liked oxo.st for the fact that they blocked Tor access since forever.
Restricting uploads from Tor is something I could somehow understand,but I couldn’t even open the links you guys shared on IRC because it just timed out.
What I totally understand is that they’re pissed of the slop bots,I have to deal with the same shit and that alone is enough that I never want to touch anything remotely related to AI
That being said,temp.sh looks quite good (works over Tor) and another similar service I’ve used over the last months is https://up.sceptique.eu
Maybe the service in UploadIt can be made configurable.
Seems to be a very useful little application,but vendor lock-in on a single provider is never a good idea.
Sorry, I do not, and don’t know of a list of such services either
I think we could atleast spin one up that needs a “secret” token you put into UploadIt directly. That doesn’t really imrove security in any meaningfull way, but should keep away all the AI crap untill they figured this one out xD