Bonjour

Je cherche a optimiser ma command shell dans applescript.

Voici mon script
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
	set Chemin to (votreChoix as text)
		set S to quoted form of POSIX path of (Chemin)
		do shell script ("cp -P " & quoted form of POSIX path of (Chemin) & "*.pdf  " & quoted form of POSIX path of (Chemin) & dossier_origine)
		do shell script ("cp -p " & quoted form of POSIX path of (Chemin) & "*.PDF  " & quoted form of POSIX path of (Chemin) & dossier_origine)
Le problème est que je dois faire 2 lignes pour presque la même chose.
Et s'il n'y a pas de pdf mon script plante .

Pouvez vous m'aidez à optimiser cela.

Merci par avance