Comments (8)
Hi all. I've gone with a different approach using the functions outlined in the 2.1.0 release
https://github.com/samknight/slack_applescript/releases/tag/2.1.0
from slack_applescript.
Hahah yeah I have the same issues.
I made a script that sets the status as the spotify song I'm listening to.... and you can imagine the mess
So I think I will try to do this improvement. I think that apple script may have some feature to help us do it.
(in the very moment I was typing rn it did that hahaha lol)
from slack_applescript.
Okay, just found out that the cmd + shift + y keystroke does the job for setting the status specifically
Imma try to change that
from slack_applescript.
Hi both, ensuring the message box is focused has been a big headache for me, ensuring it's empty as well adds an extra layer of complication. Would either of you run an experiment for me? Could you add these commands above the slack commands? - this essentially selects all and deletes within the slack application
tell application "Slack"
activate
keystroke "a" using command down
delay 0.5
key code 51
end tell
from slack_applescript.
Hello, I could just run it now. It does not really function properly. Another thing is that we need to call "System Events" to send key code
and keystroke
commands. So my quick fix was:
tell application "Slack"
activate
tell application "System Events"
tell process "Slack" to keystroke "a" using command down
tell process "Slack" to key code 51
end tell
delay 0.5
end tell
When I run it and I am inside a chat, with the checkbox selected, it selects whatever is inside the message box.
But in many other cases, like if I am just scrolling messages, it selects all the visible chat. (Let'sn't forget that slack uses electron)
We could try to force that the message box is selected maybe...
Another thing is: is there any possibility to prevent a desktop switch? It is super annoying to call this script via another automation tool (I use hammerspoon to do some weird behaviour that will set my slack status as the song I am listening to on spotify, I know it's unprofessional but lol) And whenever the song switches the desktop switches and it's annoying and a mess and my only dream was to have a discord like feature so i can show off my music... anyway)
At the time of writing I maybe came up with a solution:
- If you type / on slack it will open the prompt and you can type anything to send in the message box.
- But what it actually does is that it does not really send the message, it just focus the message box.
- We can then delete the N characters from the message box, select all, copy to a temp storage
- Send our actual slack command
- Restore the message box w/ the content of that temp storage.
What y'all think?
from slack_applescript.
This seems to get things close but doesn't work if you're focused on a thread. Also cmd+a works for me once I've used /
- type /
- escape
- cmd+x (to cut the existing text)
- do the message
- cmd+v
We could add that but with the caveat that this won't work for the main channel whilst your are in a thread
As for the desktop switch, due to electron app and non-first party support for these kind of scripts I don't think this will ever be possible. Very happy to be proven wrong though.
from slack_applescript.
Ok I just found out that you can exit the thread with option + up/down, which will also move you from the current channel.
As for the desktop switch, due to electron app and non-first party support for these kind of scripts I don't think this will ever be possible. Very happy to be proven wrong though.
I am going to take a deeper look if there is any additional tool we can use to achieve that.
from slack_applescript.
I think I have found a combination that works.
arrow up
arrow left
arrow down
from slack_applescript.
Related Issues (20)
- can you add the uncompiled source to the repo for security review? HOT 2
- error when focusing workspace HOT 2
- Script error when Slack set to French HOT 2
- Nothing works HOT 3
- Hoping for listing workspaces and channels HOT 4
- Status command sometimes malforms HOT 2
- Clearing Status is not working HOT 3
- mini guide / advice on reverse engineering Slack.app HOT 1
- [Question] Is it possible to get the amount of all unread messages? HOT 1
- Can't get script "Slack" HOT 5
- Where is the source? HOT 2
- Is there a way to get a title of currently focused Slack channel? HOT 1
- Not a valide command HOT 2
- Support "for" in set status command HOT 2
- not a issue but a feature request HOT 1
- Set as Away & Set as Active not working HOT 2
- Respect hidden Slack during operation HOT 1
- Commands won't execute if Input Option to use "Cmd Enter" is selected HOT 3
- Away command clashes with similar hubspot command
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack_applescript.