Отсканируй на iPhone, чтобы установить
Run Sidecar from iPad even while Mac is sleeping/locked or closed, affectively allowing Sidecar to be used In headless mode.
Instructions:
- Please make sure to enable remote login under sharing in system preferences.
- If you will be running this shortcut while computer is locked or closed, Make sure power nap is enabled under power save settings and plugged in.
- To access your Mac's IP address click on sharing again in system preferences. At the top it should say your Mac is accessible at name-MacBook-Pro.local or something similar. Copy paste this into the shortcut Mac IP import question.
Please note this shortcut can take up to 6 seconds to complete be patient before running again. If Shortcut is run while Mac is already connected, Mac will be disconnected and sent to sleep mode.
Что нового
Версия 1.0
First release
Что делает
Действий: 9-
Text
-
If
-
Set VariablePassword
-
If
-
Ask for InputMacOS Password?
-
Set VariablePassword
-
Get Device Details
-
Nothing
-
Run Script Over SSH
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#include 'actions/network'
#include 'actions/device'
#define color blue
#define glyph circledPower
const Text = "nil"
if Text {
@Password = Text
} else {
prompt("MacOS Password?")
@Password
}
getDeviceDetail("")
nothing()
runSSHScript("caffeinate -u -t 4\nosascript -e 'tell application \"System Events\" to key code 123'\nosascript -e 'tell application \"System Events\" to keystroke \"{@Password}\"'\nosascript -e 'tell application \"System Events\" to keystroke return'\n\nsleep 4\n\n\nosascript <<EOD\ntell application \"System Events\"\n tell process \"SystemUIServer\"\n click (menu bar item 1 of menu bar 1 whose description contains \"Displays\")\n if menu item \"Stop Airplay\" of menu 1 of result exists then\n click menu item \"Stop Airplay\" of menu 1 of result\n tell application \"Finder\" to sleep\n else\n click menu item \"{}\" of menu 1 of result\n end if\n end tell\nend tell\nEOD\n", nil, "foos-MacBook-Pro.local", "", "foo bar", "", @Password)
Открыть в Cherri Playground
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Вам также может понравиться
Реклама