Page 1 of 1

receiving AppleScript Tokens

PostPosted: Wed May 17, 2017 11:10 am
by gflinch
I have a embedded AppleScript that extracts exif information from a image and passes it on to Hazel via multiple tokens. These tokens are used to name sorted folders. I am having a problem with the tokens working. They are not passing the correct information along and doing it in a somewhat random pattern.

i.e.:
custom token1: cameraMake
custom token2: cameraModel
custom token3: country

Applescript return:
Code: Select all
return {hazelPassesScript:true, hazelOutputAttributes:{cameraMake, cameraModel, country}}



folder structure:

Date>token1 token2>
file rename: "token2 token1 token2 extension"

Now, a image may NOT have all of the data available (country for example) and I am thinking it would just be ignored and move on to adding the other tokens to the name.

I can verify by making the AppleScript a standalone and run it without hazel one the same files that the extracted info is there. However when I run it with hazel as an embedded script, the files that have ALL the data are getting messed up, cameraName is being used as country.

I'm kind or stuck.

I will post pictures if I need to clarify.

Re: receiving AppleScript Tokens

PostPosted: Thu May 18, 2017 10:12 am
by Mr_Noodle
I suggest displaying values in the script. Print out the array before you send it to Hazel to make sure it's correct there.