Cargando

Automator desde multiples ventanas




Pulsa corazón para recibir avisos de nuevas Respuestas

  AUTOR PREGUNTA

Publicado 14 octubre 2014 - 05:23
He creado una accion de tipo automator (servicio) el cual busca dos archivos o directorios y luego realiza una accion basada en sus rutas o sus nombres de archivos. El problema es que cada par de archivos o directorios esta en una ruta diferente. Puedo abrir hasta dos ventanas con Finder y seleccionar el archivo o directorio en cada uno pero cuando trato de correr mi accion Automator solo pasa el nombre del archivo desde la ventana actual del Finder.

Como puedo hacer para que correr mi Automator en diferentes directorios?

Les dejo mi Automator que tiene una sola acción:

for filepath in "$@"; do P4TH=`echo "$filepath" | rev | cut -d/ -f2- | rev` FILE=`echo "$filepath" | rev | cut -d/ -f1 | rev` echo "P4TH=$P4TH, FILE=$FILE" >> /Users/usuario1/debug.txt done

  • ¿Tienes la misma pregunta? Yo también
  • Volver arriba

Esto también te interesa!

 

Publicado 14 octubre 2014 - 20:22
Esto es posible seleccionando una segunda ventana desde la selección, inserta una accion de "Run AppleScript" en la primera posicion del flujo de trabajo, limpia todo el texto y coloca el script en la accion:

on run {input, parameters}
tell application "Finder"
activate -- doesn't work without the activate
open target of Finder window 2 --- select the second Finder window
set end of input to (item 1 of (get selection)) as alias -- append the selection (in the second window) to the input list
open target of Finder window 2
end tell
return input
end run


 

Publicado 14 octubre 2014 - 20:23
Prueba con el siguiente script:

set thePaths to {} -- empty list (* NOTE THIS SCRIPT WORKS WHEN THE WINDOWS ARE IN LIST VIEW *) tell application "Finder" activate set theWindows to target of windows -- get the windows target paths repeat with i from 1 to number of items in theWindows -- repeat for each window set this_window to item i of theWindows -- get window #n set thisSelection to my getSelected(i) as string -- run sub routine and pass the item count as the arguments set thePath to POSIX path of (item thisSelection of this_window as alias) -- convert the path to unix style path copy thePath to end of thePaths -- add to list end repeat end tell Return thePaths on getSelected(i) set theRowSelection to "" -- declare variable tell application "System Events" tell process "Finder" set theRowSelection to value of text field 1 of UI element 1 of ((rows of outline 1 of scroll area 1 of splitter group 1 of window i) whose value of attribute "AXSelected" is true) -- get the selected item by using the attributes of the window - WHICH HAS THE SIDE BAR SHOWING if theRowSelection is {missing value} then -- THE SIDE BAR SHOWING WAS NOT SHOWING SO THE scroll area 1 NEEDS TO CHANGE TO scroll area 2 set theRowSelection to value of text field 1 of UI element 1 of ((rows of outline 1 of scroll area 2 of splitter group 1 of window i) whose value of attribute "AXSelected" is true) end if end tell end tell return theRowSelection -- return the selected item name end getSelected


   AUTOR PREGUNTA

Publicado 15 octubre 2014 - 00:49
Gracias Jhony!


X