Topic: Cannot execute scripts in plugin bundle

I plan to execute a shell script when I drop a file to DZ. As I am running a non MAS version I still get errors that the script cannot be executed (same goes with swift executables or any other executables).
The scripts are bundles with the plugin so they are in the same folder like the "action.rb" ruby file.

Invocation goes like

 $dz.begin("Starting some task...")
  
  # Below line switches the progress display to determinate mode so we can show progress
  $dz.determinate(true)
  
  output = `getDatabases.sh` #is executable (755)
  puts $?.success?
  puts "output is #{output}"

  # Below lines tell Dropzone to update the progress bar display
  $dz.percent(100)

Error shows up like

/Users/tso/Library/Application Support/Dropzone 3/Actions/Confluence Upload.dzbundle/action.rb:38:in `exec': No such file or directory - /Users/tso/Library/Containers/com.aptonic.Dropzone3/Data/Library/Application (Errno::ENOENT)
    from /Users/tso/Library/Application Support/Dropzone 3/Actions/Confluence Upload.dzbundle/action.rb:38:in `dragged'
    from /Users/tso/Applications/Dropzone 3.app/Contents/Actions/lib/runner.rb:71:in `call'
    from /Users/tsoApplications/Dropzone 3.app/Contents/Actions/lib/runner.rb:71:in `<main>'

So any help will be greatly appreciated.

Cheers
Thorsten

Re: Cannot execute scripts in plugin bundle

That error output indicates to me that you're still running the sandboxed (Mac App Store version) of Dropzone. I would close Dropzone and delete your version of Dropzone from your Applications folder and re-download from https://aptonic.com/dropzone3/latest - you can verify that it's the non-Mac App Store version by checking if there is an 'Updates' tab in the Preferences. You definitely can't call other scripts or executables under the sandboxed version, so that's the first thing to fix.

Now, also you need to put a ./ in front of the getDatabases.sh call. So change your line calling getDatabases.sh to the following:

output = `./getDatabases.sh`

And make sure the getDatabases.sh file is inside the action bundle.

Hope that helps!

Re: Cannot execute scripts in plugin bundle

John,
thank you for your quick response. I discovered that when I changed to the non MAS version, my bundle was in the sandboxed folder so I created a new bundle and the folder was not sandboxed any more. When I created a new bundle and copied my code, all went fine.

Cheers
Thorsten