Giter Site home page Giter Site logo

Comments (18)

samknight avatar samknight commented on July 18, 2024 1

Ok I'll see what I can produce and get some feedback from everyone (pomodoro timings would've been ideal though!)

@josebama preview his Alfred set up here (I think requires premium) #4 (comment)

Essentially you can have one workflow that sets the status, runs a timer and then clears the status. Not ideal as it will interrupt your screen to perform the changes but an interim solution possibly

from slack_applescript.

samknight avatar samknight commented on July 18, 2024 1

Hi all,

I think I have something working now. This is very much a test carefully feature right now as the UI part makes it very brittle. There are issues I've not been able to overcome yet where if my mouse is in the position on screen where the dialog pops up it ruins the tab ordering.

Any help to overcome this would be appreciated.

set status "on lunch" until "8:30 pm"
set status "on lunch" with icon ":knife_fork_plate:" until "20:30"

Note that you can use a 12 hour clock or a 24 hour clock. I am only support same day status clearances currently but should be enough for most pomodoro cases.

I won't be working out the in X minutes or in Y hours just yet as that adds some more complications I don't think the library is ready for just yet. Once this is stable then I'll look to add some of that functionality

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

Will take a look - thanks for the idea

from slack_applescript.

josebama avatar josebama commented on July 18, 2024

I've been looking at doing the same thing, but I believe it's not possible with slash commands. The only option that I could see is instead of using the slash command for setting the status, navigate through the UI with keystrokes.

Something like βŒ˜β‡§Y, text, β‡₯, emoji, β‡₯, β‡₯ and then choose one option from the list with the arrow keys but that's slow, very limited in options and very fragile, as any tiny change in the UI could break it.

I guess we will have to wait for Slack to allow setting expiring statuses through slash commands.

If you are using Alfred, you can add a delay and then call clear status:
Screenshot 2020-04-07 at 09 31 40
but you will lose focus of whatever you were doing when the time to clear the status comes

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

That's a cool technique - I do have some UI management flows e.g. focussing windows and they do seem to break fairly regularly. I could create an option where if you set the timer it goes through a UI function but if left blank it uses the slash command?

from slack_applescript.

josebama avatar josebama commented on July 18, 2024

You could do something like this to set a status for 30 minutes:

tell application "System Events"
    keystroke "y" using {command down, shift down}. # Display status change dialog
    delay 0.2
    keystroke "Lunch break"  # Status text
    keystroke tab  # Highlight emoji selection button
    keystroke return
    delay 0.2
    keystroke ":sandwich:"  # Search emoji
    delay 0.2
    keystroke return # Select first result
    keystroke tab  # Emoji selection button
    keystroke tab  # Clear text button
    keystroke tab  # "Clear after" dropdown
    delay 0.2
    key code 126  # 4 hours
    key code 126  # 1 hour
    key code 126  # 30 minutes
    keystroke return
    keystroke tab  # Save button
    keystroke return
end tell

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

Thanks - I have been looking into it. My struggle at the moment is designing a nice usable dictionary definition for this.

I could create a definition for each one
set status x for 1 hour
set status x for 4 hours
set status x and bring up date picker

but it doesn't feel user friendly to me yet. Have you got any ideas?

from slack_applescript.

juliagarrigos avatar juliagarrigos commented on July 18, 2024

Hi!

I would also love to have this feature πŸ˜„ I actually need to clear the slack status after 25min (I'm working with the pomodoro technique and it divides time in chunks of 25min, I'm trying to communicate it to my colleagues with my slack status).

I don't know why do you think that set status x for 1 hour or set status x for 4 hours is not user friendly, I found them pretty clear and readable. I would really appreciate having the minutes version:

set status x for x minutes

Thanks!

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

Hi Julia,

The difficulty I was having was communicating the the preset values slack offers (1 hour, 4 hours etc).

They do have a custom option but it presents a calendar view which could be a little more brittle to code against the UI. Also trying to surface the options clear after today/this week isn't easily revealed.

I think there's enough demand now though for me to give this a go and use the custom method by default perhaps, but I think it will be one of the trickier items to build robustly.

I'll keep this thread updated

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

Sorry Julia

A further update. It seems 25 minutes isn't really an option within slack - you can only choose a specific date and time at half hour intervals.

Perhaps we are heading into the area of needing this to become more of a background app that can run using this library as the core library.

Are you running any other tools such as Alfred/Keyboard Maestro?

from slack_applescript.

juliagarrigos avatar juliagarrigos commented on July 18, 2024

Thanks a lot for the explanations, now I understand what you meant πŸ˜„

A further update. It seems 25 minutes isn't really an option within slack - you can only choose a specific date and time at half hour intervals.

I would say that 30min instead of 25min would be acceptable already for my use case.

Are you running any other tools such as Alfred/Keyboard Maestro?

No, I'm running the script using the automator as explained here. I have Alfred installed (only free version for now) but I don't see how it would help because it only executes the scripts right?

from slack_applescript.

josebama avatar josebama commented on July 18, 2024

Just as heads up, I ended up deleting the timer in Alfred to disable the status. I ended up sending unintended messages in slack because I would be typing when the timer would go off and switch the focus to the slack window.

What I’m doing now is set the status for 30 minutes through the UI navigation that I mentioned previously and I set do not disturb for 25 minutes through the slash command. And in the status I briefly explain that if I’m in DND I’m focusing, otherwise I’m in a break.

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

I should also add that you can be as precise with the time as you like. Not limited to half hour intervals i.e 6:51 pm is perfectly valid

from slack_applescript.

juliagarrigos avatar juliagarrigos commented on July 18, 2024

Hi @samknight,

Thanks a lot for the effort πŸ˜„ I've been trying the new until functionality and it works like a charm! I found an issue when using it with the icon though.

This command sets the status and the clear time perfectly:
set status statusMessage until endTime

But when I add the icon it fails:
set status statusMessage with icon ":tomato:" until endTime

Error: "The variable icon is not defined." number -2753 from "icon"
The status of slack after running the script:

image

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

Thanks - all fixed now in v1.3.1

from slack_applescript.

juliagarrigos avatar juliagarrigos commented on July 18, 2024

@samknight I pulled the current master version and I still have the icon issue I commented. Thanks!

from slack_applescript.

samknight avatar samknight commented on July 18, 2024

Once more for luck! v1.3.2

from slack_applescript.

juliagarrigos avatar juliagarrigos commented on July 18, 2024

It is working now, thanks a lot!

from slack_applescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.