shell 2013 (2017 update, Windows version)

11OLSEN's icon

there are default objects that let you save a textfile so there's is no external file at first to ring the bells. but yea let's stop

Source Audio's icon

Don't expect cycling to include anything dealing with low level system integration in standard release. Even creating a folder somewewhere without opening a dialog never happened...
Thanks to Jasch that became possible 10 years or more after mkdir object was released.
So in the meantime, we got the shell object working on windows, that's just very helpful, and I don't care if it's official, unofficial or whatever release.

Jeremy's icon

Well, we have included some stuff in the past, in terms of JS support for the file system (but without deletion, for instance) and other things. As for shell, the official answer from my corner of C74 is "I don't know". In any case, thanks for the interest, please let me know if anything fails to work, and I'll try to get a proper package release out in the coming days.

Jonas Damm's icon

Hi Jeremy, thank you for this great tool!
I am having some trouble with ssh. I can successfully use it and also transmit commands like
'ssh pi@192.168.178.58 "gpio -g write 22 1"', but it seems, the shell terminal that is running in the background closes after it did its job. However, I would like to establish a ssh connection initially and then later send commands in the running ssh terminal. is that possible with the shell external in windows? I have a feeling 'penter' or 'pwrite' might be the way to go, but I am not sure how to use them.. so far I have to log in to ssh, everytime, I want to transmit a command. And because i have to send allot of them, the cpu is running high and the network is stressed aswell. Thanks agian!

Jonas Damm's icon

I figured it out. Now I can use ssh (almost) exactly how I wanted. I would like to report an interesting bug tho: If I use ssh to read out a gpio pin from my Raspberry Pi, shell can't handle "0", "1", or any one digit number for that matter. If it gets such a number, it will print garbage symbols. I changed the output with a bash line to "1000" and "999". Now it works totally fine. Very funny bug. Shell is awesome.

Jeremy's icon

Would you please send me your Max patcher + whatever you're running on your RasPi? You can send it privately at jeremy (at) cycling74 (dot) com .

I've created a Github repository for shell: https://github.com/jeremybernstein/shell

Jonas Damm's icon

Hi Jeremy, I send you an email. I hope everything you need is included.

missmiss's icon

Hi, @JEREMY

my English is not very good... what I want to do is : capture images from jit.grab, save them into a folder(I already finished these part), but what I'm trying to do is to print those .jpg snapshots. Can shell object doing this task?

thanks a lot!

Roald Baudoux's icon

Thanks for the Windows version. Happily controlling MiniCap.exe here.

Jeremy's icon

Thanks for letting me know! I'm glad it's working. :-)

Jean Lochard's icon

Hi Jeremy,

I'm trying to use the shell object on windows to copy files to a folder.
I first try to build my command with one sprintf but it removed all the \ after conformpath.
I finally found another way by using two sprintf in the patch bellow.

Max Patch
Copy patch and select New From Clipboard in Max.

The command seems to be correct (I had quotes to deal with spaces in path names) but it does nothing thru the shell object.

If I make a copy of the commnd from the Max console and try to run it in the command line window, it works (after removing "print:" from the copy of course!).

Any idea ?

Thanks!

Jean

Luca Caridà's icon

Hi there,
I'm trying to use the shell object as part of the sample patch PhilipsHue included in the Max for Visual Artist package. Max is running as 32bit application under Windows10 and I receive this error:

print: 'curl' is not recognized as an internal or external command,

even if it seems curl is working ok from cmd (see below).

Any hint? How could I fix this?
Thank you : )
Luca

caption from cmd

PhilipsHue.maxpat
Max Patch
PhilipsHue original patch

dub's icon

Hi Jeremy,

First, thank you for this last version of shell !

I try to use it on my Max For Live project (a project I have been developing and upgrading for many years). This project doesn't contain any audio on Max, it has only clip managing and stuff like that.

Here is the problem I have : every time shell is called, there is a CPU overload which provokes the main sound on Live to be disturbed (as would happen with a failing soundcard).
I had tried Bill Orcutt's version and had the sam problem.
I had not this problem using Masayuki Akamatsu's aka.shell, but this latter is only 32bit.

This happens using whatever type of command : GetFileInfo, osascript, etc...

Do you have any ideas about this ?

Thank you !

Here is my configuration : Live 9.7.5 , Max 7.3.4, OSX 10.12.6.

Jeremy's icon

Hi, you'll need to send me the project (or something which demonstrates the problem) and I'm happy to take a look.

dub's icon

Jeremy,
Thank you for answering.
As the project has lots of ramifications and controls via multiple Lemur on iOS, I will prepare a compact standalone version which reproduces the problem, and send it over to you.

andeutung's icon

Hi Jeremy,
Shell.mxo cannot get ffmpeg status on mac??
in case of windows shell.mxe, I could get ffmpeg status messages from left outlet by ffmpeg's -stats command, but couldn't get on mac.

Jeremy's icon

Hi @andeutung, gimme a patcher please.

andeutung's icon

@Jeremy
This is patcher text file.
I used shell 2013 version. I updated shell.mxo to latest version, then ffmpeg command is not working in latest shel. so I returned to 2013 version. if you check this patcher, plz check both versions of shell. both shell objects don't output anything about ffmpeg status, except -versions command.
btw, if we do ffmpeg command in latest 2017 shell, we need to prepare .sh script file and use bash xxx.sh command... It can do process, but I think it's not suitable for max users...
and plz check on windows (probably need to change something in patcher.), you get to see that windows shell output ffmpeg status messages. windows ver is perfect.

ffmpeg-shell2013.txt
txt 9.53 KB

Jeremy's icon

couple of things:

1. use the @stderr 1 attribute to merge stderr with stdout and you'll see the error messages your patcher is generating (this used to happen automatically)
2. don't use tosymbol to merge the command line into a single symbol -- the newer object parses correctly

andeutung's icon

Thanks JEREMY, it is working fine :D

mauser's icon

Hello,

Im trying to delete all files from a folder using applescript.
I tried everything I could find on the internet but with no luck
one of the things I tried:

osascript -e 'tell application \"Finder\"' -e 'delete every item of folder \"/Users/maurits/Desktop/test\"' -e 'end tell'

Must be some stupid mistake I am making.

I hope someone can help

Source Audio's icon

Why not :
rm -rf /Users/maurits/Desktop/test/*

mauser's icon

Thanks for the suggestion.
Because I actually want to use the "ending with" function. So I can delete files with certain names. I thought I'll first try this.

Source Audio's icon

also find works well for that :
find /Users/maurits/Desktop/test/ -name *.jpg -delete

would delete all files ending with .jpg

mauser's icon

thanks!

what would be de correct formatting for use with the shell object?
And can you also include for example the last few letters of the filename before the extension?

Source Audio's icon

You can use find just as is.
Only problem would arrise if You have spaces in file path or name.
Than one has to fiddle arround till it works.
Example with ending :
find /Users/maurits/Desktop/test/ -name *abc.jpg -delete
Another example with space in folder name:
find ~/Desktop/\"aaa bbb\"/ -name *abc.jpg -delete
Here path to user folder is done with "~/"
Gets handy if You don't know user name.


Source Audio's icon

rm -rf "/Volumes/OWC RAID/Dropbox/Popcorn 180420/Synth2 copy 5.json"

should actually work.

Maybe You can't delete it without admin privileges ?
Try it from terminal, just rm -rf and than drag file for path

Robin Parmar's icon

Despite the name of this old thread, I don't see a Windows build here:
https://github.com/jeremybernstein/shell

I do see a note in the OP that there is no Windows build.

Illumination?

Source Audio's icon

In this very thread on page 1 is a download link :

http://expr-i0.net/shell_170717.zip

to_the_sun's icon

Is it just me or is the Mac version missing from that download?

Rob Ramirez's icon

I've just edited the original post to include the correct versions of both mac and windows as attachments to that post.

to_the_sun's icon

Thanks for that. So do I need to add the .mxo extension to the shell file for it to work? (I'm actually on Windows, so I don't know, just trying to make sure my application is cross-platform)

Jeremy's icon

I've updated the first post with all 3 externals :
* .mxo (OSX fat 32-/64-bit)
* .mxe (Windows 32-bit)
* .mxe64 (Windows 64-bit)

and added the old help file as well. At some point, I'll package this all up properly and add a release to the github page, but time is fleeting.

Music_SDP's icon

Hi Jeremy! Absolutely adoring shell. Thank you for building this and continuing to maintain it!
I've been attempting to run a process in the background by using the & command at the end of my line. However, doing so seems to cause the command either not to send or not to be processed by shell.
Is it possible to run processes in the background with shell? Do I use &, or is there another method I should know about?

Jeremy's icon

Hi @Music SDP -- that probably won't work as you expect: shell isn't a terminal, it's forking a process and running a command line program. In a sense, it's already doing what you want with & -- shell itself is not blocking the UI thread except when it posts output and the executing command is also outside of Max's process space.

Maybe you can provide a little more information about what you're trying to do, though.

AudioMatt's icon

Where is the official current object release available for download? I'm seeing multiple links to various places including the Tool page which links to the 2013 version. (mac if that matters)

Jeremy's icon

Maybe it's time for a new thread...

Jeremy's icon

THIS THREAD IS HEREBY CLOSED. PLEASE USE THE NEW ONE.