Execute Shell Script: Solution for Truncated Results

Hi all, I'm pulling my hair out on this one, maybe someone can help.

This question is more about terminal commands in general, I think, but it applies to a macro I'm working on in KM with Execute Shell Script.

I am using Maestral (the great lightweight dropbox client for mac), and trying to use Execute Shell Script in Keyboard Maestro to generate and capture share links.

Here is the shell script I'm running, which mostly works fine:
/usr/local/bin/maestral sharelink list '10_42_21.pdf'

The result is the shared links for that file, but since it's formatted in a table view, the column containing the link is truncated with:

I've tried resizing the window and even writing to a text file, but I can't get it to show the full links.

When running the command in mac terminal, the results are truncated depending on the width of the terminal window.

I'm not great at terminal commands, but maybe there is something that can do one of the following:

  • set the max width of the table
  • wrap the columns so all the text displays
  • output the table as simple text (exploding it into separate rows or something)

Thanks in advance for any tips!

It’s possible this problem has been fixed in the most recent update to Maestral: GitHub commit message.

The first thing I would do is update Maestral and see if the problem goes away. If it doesn’t, there might be some ways to fool it into thinking it has a wide terminal.

1 Like

Wowwww how did you possibly find this?

It looks like that file with the change was commited to the repo just 2 days ago, but the latest release is from 13 days ago. Do you think I need to wait until the dev makes another release, or can I download the files as a zip and run the code? I'm asking just because although I know the basics of GitHub, I'm not an expert, so maybe the answer is obvious.

Thanks so much for your help!

Try something like this:

COLUMNS=1000 /usr/local/bin/maestral sharelink list

Hey Joel,

This is not a live link...

-Chris

Just luck. I went to GitHub to see if there were complaints about the width of output, and saw that the most recent change was about your problem.

I assume there are instructions for installing Maestral after you download the current update, but that’s probably more complicated than @tjluoma’s solution.

2 Likes

That did the trick, thanks so much! I spent literally all day trying to figure this out. I didn’t realize you could just add a prefix like that to a command. Lots more to learn about terminal I guess!

You're welcome. Glad it worked. Setting a variable like that is a pretty advanced tip, so don't feel too badly about not knowing it.

1 Like

Thanks again for everyone's help on this. Here are the resulting macros, in case any of you are Maestral users (you should be!) Macros for Maestral (Lightweight Dropbox Client)

1 Like