Open akucharczyk opened 2 years ago
To add, specifying the height manually does work in AppleScript.
tell application "Desk Controller"
move to "125cm"
end tell
looks like it's simple copy-paste mistake. both command codes in deskcontroller.sdef
are the same.
Same for me. I'm running the script in Script Editor and setting the height works, but setting "to-stand" (or "to-sit") doesn't. No errors, no messages.
I'm in the latest Ventura release.
Let me know if I can do anything for debugging.
@alvarogonzalez-packlink I fixed it in my forked branch and added Notification. There is currently no signed or build version uploaded, so you need this to build by your own on your local system.
I wrote a bash script for this which works for me and I thought I'd share if anyone wanted something like it;
#!/bin/bash
ACTION=$1
HEIGHT=$2
# preset heights
SIT="80cm"
STAND="110cm"
# height check values
MAX_HEIGHT=115
MIN_HEIGHT=75
# colours
NOCOLOUR='\033[0m'
RED='\033[0;31m'
ORANGE='\033[0;33m'
warning() {
echo -e "${RED}$1${NOCOLOUR}"
}
hint() {
echo -e "${ORANGE}$1${NOCOLOUR}"
}
desk_move() {
osascript <<EOD
tell application "Desk Controller"
move to "$1"
end tell
EOD
}
height_check() {
if [ -z $HEIGHT ]; then
warning "ERROR!"
echo "Height not supplied"
exit
elif (($HEIGHT > $MAX_HEIGHT)); then
warning "ERROR!"
echo "Height $HEIGHT is too high"
exit
elif (($HEIGHT < $MIN_HEIGHT)); then
warning "ERROR!"
echo "Height $HEIGHT is too low"
exit
fi
}
if [ "$ACTION" == "sit" ] || [ "$ACTION" == "stand" ]; then
if [ "$ACTION" == "sit" ]; then VALUE=$SIT; else VALUE=$STAND; fi
echo "Moving Desk to $ACTION - $VALUE"
desk_move $VALUE
elif [ "$ACTION" == "height" ]; then
height_check $HEIGHT
echo "Moving Desk to height - $HEIGHT"
desk_move "${HEIGHT}cm"
else
warning "Missing action"
hint "Available actions:"
echo "desk sit"
echo "desk stand"
echo "desk height <NUMBER>"
fi
To add, specifying the height manually does work in AppleScript.
tell application "Desk Controller" move to "125cm" end tell
Thanks this is good workaround
This used to work on my previous Mac but strangely it no longer works. Interestingly Script Editor automatically changes move "to-sit"
to move to "to-sit"
tell application "Desk Controller"
move to "to-sit"
end tell
I currently writing raycast extension which works with your application and gets the following issue.
Since the new version, the following two apple scripts do not work anymore. I did not get any error message when I run the script. You can check out my code in the following Mr https://github.com/raycast/extensions/pull/1964.