Как открыть новое (или существующее) окно Notes в AppleScript? - PullRequest
0 голосов
/ 12 января 2020

На своей работе я использую MacOS и не обладаю правами администратора, но я стремлюсь существенно сэкономить время, когда я прыгаю на новый компьютер Ma c (его сотни, поэтому каждый день у меня есть потратить 20 минут на вход в систему / настройку), создав и запустив скрипт, который открывает все нужные мне приложения и размещает их в нужном месте. Пока у меня есть все, что я могу на самом деле перемещать (без привилегий Accessibility, которые я не могу сделать), и для приложений, которые я не могу перемещать без привилегий, я просто написал сценарий, чтобы открыть их, чтобы я мог позиционировать их вручную, но я могу: Кажется, я не могу понять, как открыть новый экземпляр или окно Note.

На моем рабочем столе у ​​меня есть 3 отдельных Note windows, в дополнение к настоящему приложению Notes.

Поскольку я на самом деле не могу создать новый windows для Notes, у меня просто есть скрипт, чтобы открыть главное приложение и расположить его.

Вот что у меня есть (обновлено, чтобы уменьшить избыточный код):

tell application "Mail"
    activate
    set the bounds of the front window to {806, 906, 2461, 1390}
    delay 25
end tell
tell application "Notes"
    activate
    set the bounds of the front window to {1087, 787, 2461, 1390}
end tell
tell application "Calendar"
    activate
    set the bounds of the front window to {101, 787, 805, 1390}
end tell
tell application "Reminders"
    activate
    set the bounds of the front window to {806, 787, 1086, 1207}
end tell
tell application "Safari"
    activate
    make new document
    set the URL of document 1 to "http://website1.com"
    set bounds of the front window to {1077, 23, 1581, 464}
    delay 7

    make new document
    set the URL of document 1 to "http://website2.com"
    set bounds of the front window to {1246, 23, 2461, 752}
    delay 15

    make new document
    set the URL of document 1 to "http://website1-copy.com"
    set bounds of the front window to {1246, 663, 2461, 1390}
    delay 1

    make new document
    set the URL of document 1 to "https://soundcloud.com/discover"
    set bounds of the front window to {1743, 764, 2560, 1454}
    delay 1

    make new document
    set the URL of document 1 to "https://vclock.com/timer/#countdown=00:04:50&enabled=0&seconds=0&sound=custom&loop=0"
    set bounds of the front window to {0, 787, 100, 964}
    delay 1
    set bounds of the front window to {0, 787, 100, 964}
    delay 1
end tell
tell application "Calculator" to activate
delay 5
tell application "CONFIDENTIALAPP1" to activate
delay 5
tell application "CONFIDENTIALAPP2" to activate
delay 5
tell application "Mail" to activate
tell application "Notes" to activate
tell application "Calendar" to activate
tell application "Reminders" to activate
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...