Automator automatically stores results from Applescript execution, but I can' t get them inside a Shell script executed right after. I' ve trid the $@, $1, $2 variable names but i only get an empty field when running even the simplest
echo $@
Here is the Applescript code:
set dialogResult to display dialog ¬
"Inserisci i valori numerici:" default answer ¬
"0,0,0,0" with title ¬
"Input 4 Valori" buttons {"Annulla", "OK"} ¬
default button "OK"
set inputText to text returned of dialogResult
-- Divide i valori separati da virgola
set AppleScript's text item delimiters to ","
set inputList to text items of inputText
set AppleScript's text item delimiters to ""
if (count of inputList) is not 4 then
display dialog "Devi inserire esattamente 4 valori separati da virgola." buttons {"OK"} default button "OK"
return
end if
-- Assegna nomi ai valori
set valore1 to item 1 of inputList
set valore2 to item 2 of inputList
set valore3 to item 3 of inputList
set valore4 to item 4 of inputList
-- Verifica che siano numerici
try
set valore1 to valore1 as number
set valore2 to valore2 as number
set valore3 to valore3 as number
set valore4 to valore4 as number
return {valore1, valore2, valore3, valore4}
on error
return {valore1, valore2, valore3, valore4}
end try
return {valore1, valore2, valore3, valore4}
which is followed by the
echo $@
These codes run inside an Automator Quick Action. I can see Automator previewing the results, but the shell script only prints empty fields. I am passing the results of the Applescript to the Shell script as "arguments". What am I doing wrong? Thank you in advance for your time!
do shell scriptcommand that's inside the applescript.