Comments (6)
Hi,
I believe we're seeing a few issues with the delay being too short. Whilst I keep working on the beta can I suggest you add in your own delay between moving channels and pasting the message.
tell script "Slack"
focus workspace "Work"
focus channel "@platform-bot"
delay 0.5
send message "whatis " & the_text
end tell
return msg```
from slack_applescript.
I've updated the library to 2.0.0.rc1 https://github.com/samknight/slack_applescript/releases/tag/2.0.0.rc1
please give this new version a try
from slack_applescript.
Hi @samknight,
Sorry for the delay in getting back to you...
I'm afraid it's still not working for me.
I've update to 2.0.0, and also added the focus+delay snipped as above.
tell script "Slack"
focus workspace "my_company"
focus channel "@my_channel"
delay 2
send message "whatis " & the_text
end tell
I ran into 2 issue with this code:
-
execution error: System Events got an error: Can’t get menu item 1 of menu "Window" of menu bar 1 of process "Slack" whose name starts with "my_company". Invalid index. (-1719)
-
I then commented the focus workspace line. After that, the change of channel does occur, but the cursor is not in the message box and therefore the
send message
command doesn't do anything...
If I'm already on the correct channel when triggering the workflow, then for some reason the cursor is on the text box and the message does get sent (but that's defeating the point slightly)
One workaround is to repeat the focus channel line after the delay, but again, that's a little suboptimal.
from slack_applescript.
Hi, I'm sorry this is not currently working for you.
- Please see my comment on the issue raised here #18
- Again sub optimal but you may wish to try
key code 44
delay 0.2
key code 53
that should bring the text box into focus. Let me know if that works and I will add that in to the main library for release
from slack_applescript.
Hi @wabiloo Did this work for you?
I have noticed that if you have the avatar menu up. You need to escape out of that and then do the above commands but you would automatically mark your current channel as read if that menu is not up.
How have you got on with this?
from slack_applescript.
Closing due to inactivity but please feel to raise a new issue if you are still struggling
from slack_applescript.
Related Issues (20)
- 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
- clear message box or warn before entering commands HOT 8
- 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
- Can’t get menu item 1 of menu "Workspace" HOT 2
- "Slack.zip" was removed in the latest commit HOT 4
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.