Jump to content
sivabudh

My Ruby Alfred Workflow Loop Stops after "exec"

Recommended Posts

Hello,

 

I'm trying to create a workflow that does image processing to selected images in Finder. For some reason, when the script runs, it would stop executing after the first "exec" is called (e.g. when I call the "convert" command).

 

Here's what my Alfred workflow looks like: http://goo.gl/45BiWd

 

and here's what my Ruby script looks like: http://goo.gl/Fo7ssF

 

I'm sorry. I have spent many hours trying to figure out why it stops after the first image is processed (resized and alpha removed).

 

Does anyone know what the cause could be?

Share this post


Link to post

This article will explain it for you: http://rubyquicktips.com/post/5862861056/execute-shell-commands

 

Basically, Exec exits ruby to run the command. Therefore, if you are in the middle of a loop, you loop will suddenly be exited. The better way is to use backticks `. The article explains it.

 

Sorry, I just saw this post today. Otherwise, I would of spoken up sooner.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...