Thursday, November 7, 2024

applescript – How you can make this script efficiently set off at a sure time?

I am not an AppleScript coder or a technical particular person by any means however I’ve finished some analysis and got here throughout an answer for my downside assertion.

My downside assertion

How you can make a mouse click on occur at a specified time.

To that finish, I’ve discovered a easy script on-line that makes the mouse cursor click on.

Right here it’s.

inform software "System Occasions"
    click on
finish inform

And now, I’m attempting to set off this script at a sure utilizing launchd.
I’ve created a plist file underneath the “LaunchAgents” folder in Library as you’ll be able to see within the screenshot under.
enter image description here

I’ve configured this plist file to set off the script at 6AM my time. I even open the webpage and place my cursor simply above the merchandise that I need clicked to be able to scale back complexity.

Coding of the plist file

<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
    <key>Label</key>
    <string>com.mouseclick.plist</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/osascript</string>
        <string>/Customers/mugenvoid/Downloads/mouseclick.scpt</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>6</integer> <!-- Alter the hour as wanted -->
        <key>Minute</key>
        <integer>10</integer> <!-- Alter the minute as wanted -->
    </dict>
</dict>
</plist>

However for the lifetime of me, I simply can’t get it to set off on the involved time even after I load this plist file into launchd.

That is the information I have been attempting to make use of –> https://www.maketecheasier.com/use-launchd-run-scripts-on-schedule-macos/

Would recognize some assist right here.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles