alexzielenski / Mousecape

Cursor Manager for OSX
http://www.alexzielenski.com
Other
1.38k stars 166 forks source link

Mousecape doesn't apply on startup #96

Closed xtien closed 5 years ago

xtien commented 5 years ago

I have to run mousecape after I start my mac. How do I make it run at startup automatically?

sanssecours commented 5 years ago

One option is to add the application com.alexzielenski.mousecloakhelper in the directory Mousecape.app/Contents/Library/LoginItems to “Login Items” in “System Preferences” → “Users & Groups”. For more information please take a look at issue #64.

hipunk commented 5 years ago

All those tips don't work for me. Helpertool installed, helpertool not installed, cloakhelper in login items, cloakhelper not in login items. Doesn't matter, it doesn't launch. Version 0.0.6 and 0.0.6b, Mac OS X 10.13.6.

Why wait for the fix when there's AppleScript - copy and paste everything below into Script Editor.app (formerly AppleScript Editor.app), save it as an Application and put that newly created AppleScript Application into your startup items. Read the comments in the script.

-- written by hipunk
-- Public Domain

-- launch Mousecape
tell application "Mousecape" to activate

tell application "System Events"

    -- I wish to set my cursor to the 11th cursor in my Mousecape list
    -- If the cursor you wish to use is the e.g. the second cursor
    -- in your Mousecape list, change the 11 to a 2. If there's only
    -- one cape (at the top) in your Mousecape list, change it to a 0.
    -- key code 125 is the arrow down key
    repeat 11 times
        key code 125
    end repeat

    -- key code 36 is the enter key, as command + enter sets the cape
    key code 36 using command down

end tell

-- Job done
tell application "Mousecape" to quit

I love Mousecape, it's the best thing since sliced cheese!

fnankivell commented 5 years ago

Same problem here. Version 0.5 would work just fine at launch using the trick sanssecours mentionned in the 2nd post. Tried the smart AppleScript by hipunkk but no luck either.

I'm on Mojave 10.14.3, will revert to 0.5 until Alex can figure out a fix, even if I get the pale cursor problem that's not really a bother for me.

Thanks Alex for keeping Mousecape alive!

hipunk commented 5 years ago

@fnankivell: Tried the smart AppleScript by hipunkk but no luck either.

Works for me.

However I fixed it:

Apply Mousecape 0.06x capes at login workaround


-- Copyright (C) 2019 hipunk

on run {}

    global cursorSelection

    -- **********
    -- * README *
    -- **********
    -- * cursorSelection represents the n-th cursor in your Mousecape list
    -- * So if you wish to set your cursor to the first cape in your Mousecape list
    -- * aka. the one at the top, leave it a 1. If you wish to set your cursor to the
    -- * fifth one in your Mousecape list (counting from the top), change the 1 to a 5
    set cursorSelection to 1

    -- launch Mousecape at login
    delay 35
    tell application "Mousecape" to activate

    tell application "System Events"

        repeat (cursorSelection - 1) times

            -- key code 125 represents down arrow key
            delay 1
            key code 125

        end repeat

        -- key code 36 is the enter key, as command + enter sets the cape
        delay 1
        key code 36 using command down

    end tell

    -- Job done
    tell application "Mousecape" to quit

    return

end run

Now it should work for everybody!

NordJan commented 5 years ago

@hipunk 👍 Thanks, I followed your 'recipe', put everything in place, restarted, ran into an error message, fixed my own typo, restarted again and Mousecape is alive (after 35 secs). Cheers.