2

I have created an automator application that searches a shared folder on another mac within the network.

I want to show all the results in one window.

I have tried using Reveal Find Items, but it opens up the directory of which each file is in, not exactly ideal.

2

View results only works as a workflow during debugging - as a standalone app it goes nowhere. I'm looking for a way to display all the results in a simple window (simpler than showing as finder items), and not finding much. My current answer is to use a python script step with Tkinter, adding a listbox for my items.

import sys
from Tkinter import *
try:
  root = Tk()
  sb = Scrollbar(root)
  sb.pack(side=RIGHT, fill=Y)
  lb = Listbox(root, yscrollcommand=sb.set)

  for f in sys.argv[1:]:
    lb.insert(END, f)
    index = lb.size() - 1
    if index % 2:
        lb.itemconfig(index, bg='light blue')

  lb.pack(side=LEFT, fill=BOTH)
  sb.config(command=lb.yview)

  root.mainloop()
except:
  import traceback
  import sys
  traceback.print_exc(file=sys.stdout)
  exit(0)

This code creates a window with a scrolling list, with coloured alternating rows, and because automator tends to eat python tracebacks (they are shown as an error, but only the first line to stderr is shown), I reroute the traceback to stdout and return with a 0 error code so I can see the traceback in the results tab.

  • Thanks for the solution to make Automator display Python error message. That saved my debug time:) – Sean Apr 14 '14 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.