"IndexError: string index out of range" when opening a program such as GVIM #657
-
I have several hotkeys that open items, such as GVIM. That script looks like: output = system.exec_command('gvim') So, it's simple, and I call it using a hotkey combination, WIN-G Every time I do, however, I get an error, which I read by clicking on Tools ⇾ View Script Error, which says: --- Start --- I've looked everywhere for answers and finally gave up and just live with it. After remembering, I have a GitHub account, I decided to post this here because from what I can tell, you are good with this. My system is Linux Mint, which is all I run, so don't know the equivalents from Windows. I've used Linux as my primary OS at work and home for ~25 years. Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 18 replies
-
Welcome to the AutoKey community! Fixed in the Beta release 0.96. You are running a program that produces no output on stdout and then trying to retrieve that null output. Shouldn't cause a problem, but it does. Either upgrade to our beta (getting help with that on our Gitter forum), or wrap such programs in a shell script that ends with |
Beta Was this translation helpful? Give feedback.
-
I never publish my scripts in an environment where someone could run them. If they want to put them in their server/workstation, they do so at their own risk. I don't give any guarantee anything I write won't cause damage to their systems, their thumbs, or their mother-in-law. |
Beta Was this translation helpful? Give feedback.
-
Good point. I do that many times, but forget many times, too.
…---
Karl L. Pearson | ***@***.***
Pardon brevity or typos. Sent from my phone.
---
On Sat, Feb 12, 2022, 12:02 PM Joe ***@***.***> wrote:
One small nit that my bash OCD won't let go of: quoting your variables
tends to avoid a lot of problems.
#!/bin/bash
"$1" "$2" "$3" ; echo
See you over on Gitter!
—
Reply to this email directly, view it on GitHub
<#657 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APCGUBPR4P42N5Y4UQBRDUDU22VELANCNFSM5MOZS2AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I think it's because both the |
Beta Was this translation helpful? Give feedback.
-
Well, for starters, your console messages look like they came from Windows, so unless you're running your program under wine or proton, you're in the wrong universe because AutoKey is a Linux only application. If you are running under wine or proton, then you may have difficulties because, while it should theoretically work, people have had problems with it and we haven't had much experience yet trying to fix them. Your code does not appear to have any AutoKey API calls in it and you appear to be using tkinter which isn't a problem, but it's more things that makes it look like you found the wrong project to post your question. Take a look at our problem reporting guide. If you still think you're in the right place, provide the information requested there so we can figure out what your problem has to do with AutoKey and how to solve it. |
Beta Was this translation helpful? Give feedback.
Welcome to the AutoKey community!
Fixed in the Beta release 0.96. You are running a program that produces no output on stdout and then trying to retrieve that null output. Shouldn't cause a problem, but it does.
Either upgrade to our beta (getting help with that on our Gitter forum), or wrap such programs in a shell script that ends with
echo
so it returns some output to appease AutoKey.