This is my first post in the community- I'm glad to be here.
I'm working on a Python shell script that scrapes data from the web and prints it into a long line text onto a touch bar button. I'm using osascript in Python to run embedded Applescript within the shell script.
My main goal right now is to get the text to automatically scroll from right to left, like a news ticker. My solution is to have the string shift/wrap around itself, while Python prints/replaces the new text on a loop.
Something like "Button Text" -> Print() -> "utton Text B" -> Print() -> "tton Text Bu" -> Print(), and so on.
The issue I'm encountering with the above solution is as follows:
After using Python's "print()" function, the button text is not cleared when "print()" is run again, so the button's text value cannot be updated/replaced. The function seems to add a new line to the button text instead (I'm assuming this because the initially printed line of text is no longer vertically center in the button).
How can I programatically, in Python or Applescript, clear the button text so the touch bar button text can be completely replaced?
Any feedback or support would be much appreciated.