Automator et Python 3

Bonjour,

Je cherche à créer un service Automator pour renommer mes photos avec leurs date et heure de prise de vue. J'ai trouvé un script Python3. Dans Automator, je choisis donc "Exécuter un script Shell". Dans le menu déroulant "Shell", je choisis "/usr/local/bin/python3" et dans Données comme entrée "comme arguments". Je copie mon script dans la fenêtre. Je teste. Il ne se passe rien. Avec le Terminal, je regarde où est Python3. Il est ici : /Library/Frameworks/Python.framework/Versions/3.12/bin/python3. Il semble donc qu'Automator ne point pas vers le bon endroit.

Je suis tombée sur un message de VikingOSX mais trop complexe pour moi.

Je vous remercie d'avance pour votre aide.

iMac 21.5″, macOS 14.0

Posted on Oct 21, 2023 7:40 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 21, 2023 8:54 AM

Shell : /usr/local/bin/python3 Passer l'entrée : en tant qu'arguments


Lorsque Python3 est installé dans cet emplacement /Library/Frameworks, les binaires sont liés dans /usr/local/bin et ces binaires savent comment trouver la bibliothèque Python3.


Vous pouvez commencer immédiatement avec les instructions d'importation dans le script Run Shell. L'astuce est que votre script Python3 trouvé importe peut-être des modules Python facultatifs que vous n'avez pas installés. Vous savez comment cela va se terminer.


Publiez une capture d'écran de la solution Automator que vous avez écrite à l'aide de l'outil d'insertion d'image et de la source de script Python3 que vous avez trouvée à l'aide de l'outil Texte supplémentaire.


Je vais l'examiner et voir ce qui peut être fait.


Soit dit en passant, ce sont des sites hébergés en anglais aux États-Unis. La publication en français rend les choses plus difficiles à cette fin.

---


Shell: /usr/local/bin/python3 Pass Input: as arguments


When Python3 is installed into that /Library/Frameworks location, the binaries are linked back into /usr/local/bin and those binaries know how to find the Python3 library.


You can begin immediately with the import statements in the Run Shell Script. The trick is that your found Python3 script may be importing optional Python modules that you have not installed. You know how that will end.


Post a screen capture of the Automator solution you have written using the Image Insertion tool, and the Python3 script source that you found using the Additional text tool.


I will look at it and see what can be done.


By the way, these are English language hosted sites in the U.S. Posting in French makes it more difficult on this end.


2 replies
Question marked as Top-ranking reply

Oct 21, 2023 8:54 AM in response to YouniaBzh

Shell : /usr/local/bin/python3 Passer l'entrée : en tant qu'arguments


Lorsque Python3 est installé dans cet emplacement /Library/Frameworks, les binaires sont liés dans /usr/local/bin et ces binaires savent comment trouver la bibliothèque Python3.


Vous pouvez commencer immédiatement avec les instructions d'importation dans le script Run Shell. L'astuce est que votre script Python3 trouvé importe peut-être des modules Python facultatifs que vous n'avez pas installés. Vous savez comment cela va se terminer.


Publiez une capture d'écran de la solution Automator que vous avez écrite à l'aide de l'outil d'insertion d'image et de la source de script Python3 que vous avez trouvée à l'aide de l'outil Texte supplémentaire.


Je vais l'examiner et voir ce qui peut être fait.


Soit dit en passant, ce sont des sites hébergés en anglais aux États-Unis. La publication en français rend les choses plus difficiles à cette fin.

---


Shell: /usr/local/bin/python3 Pass Input: as arguments


When Python3 is installed into that /Library/Frameworks location, the binaries are linked back into /usr/local/bin and those binaries know how to find the Python3 library.


You can begin immediately with the import statements in the Run Shell Script. The trick is that your found Python3 script may be importing optional Python modules that you have not installed. You know how that will end.


Post a screen capture of the Automator solution you have written using the Image Insertion tool, and the Python3 script source that you found using the Additional text tool.


I will look at it and see what can be done.


By the way, these are English language hosted sites in the U.S. Posting in French makes it more difficult on this end.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator et Python 3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.