Help With Apple Automator

Started by whirl, April 28, 2017, 09:18:55 AM

Previous topic - Next topic

StarGeek

Admittedly, this is a guess since I don't work with Applescript, but you might try changing
set camera_make to "  -make=" & camera_make
to
set camera_make to "  -make='" & camera_make & "'"

and
set camera_model to " -model=" & camera_model
to
set camera_model to " -model='" & camera_model & "'"

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

whirl

Quote from: StarGeek on May 02, 2017, 11:05:16 AM
Admittedly, this is a guess since I don't work with Applescript, but you might try changing
set camera_make to "  -make=" & camera_make
to
set camera_make to "  -make='" & camera_make & "'"

and
set camera_model to " -model=" & camera_model
to
set camera_model to " -model='" & camera_model & "'"

Thanks.

What does adding "'" do ?

Phil Harvey

He has added single quotes around the camera make and model to guard against spaces in these strings, which should work if the Automator uses the same parsing rules as a command shell.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

whirl

Quote from: Phil Harvey on May 02, 2017, 11:59:53 AM
He has added single quotes around the camera make and model to guard against spaces in these strings, which should work if the Automator uses the same parsing rules as a command shell.

- Phil

Thanks Phil.

Automator must use the same parsing rules because it worked fine.

Hubert

It's AppleScript rather than Automator that's doing the parsing, as all of this is part of a "Run AppleScript" Automator action.

For simpler reading (and typing) you can also use the "quoted form of" construct:



set camera_make to "  -make=" & quoted form of camera_make

--returns "-make='Some camera'"

set camera_model to " -model=" & quoted form of camera_model

--returns "-model='Some model'"