I am attempting to have a person choose a main key from a MySQL database, merge that string in the beginning of an inventory of chosen Finder objects, then feed the ensuing string right into a bash shell script.
It really works for precisely ONE main key, “Dwelling.” Is that some type of reserved phrase or one thing? Not one of the different main keys I choose make it via the method.
This is an image of the workflow. You’ll be able to see on the backside that “Dwelling” is on the head of the listing.
And this is what occurs if I decide something aside from “Dwelling” from the picker:
Sorry in regards to the hokey window pics. This is some extra element.
First, I choose the first keys from a MariaDB (MySQL) database, in a “Run Shell Script” portion:
/usr/native/bin/mysql
--user=GPS_User
--password=ReSu_SpG
--host=localhost
--batch --raw --silent
--execute="choose `Deal with` from GPS_Locations"
Private
The “Outcomes” tab exhibits that is working fantastic.
Then, I take advantage of AppleScript to make a picker, to decide on one of many main keys from the database:
on run {enter, parameters}
set theHandle to enter
set selectedHandle to select from listing theHandle with immediate "Choose a location:"
return selectedHandle as string
finish run
Once more, primarily based on the Outcomes button, this seems to be working. At this level, there is no such thing as a seen distinction between selecting “Dwelling” (which works) and every other merchandise, which does not.
Subsequent, I do “Get Chosen Finder Objects.” It is Outcomes window exhibits seven objects when “Dwelling” was chosen because the database key, however solely six objects when anything is chosen!
At this level, it actually would not matter what occurs within the subsequent shell script, which is anticipating n+1 objects, the primary of which is among the keys chosen earlier than, adopted by an inventory of file names.
Any concepts what is going on on right here, and why Automator appears to be fixated on “Dwelling?”