Voici ce qui pourrait servir à écrire le nom du fichier au début de
celui-ci. Travail de débutant sans doute très perfectible...et à
tester..avec prudence car il est assez facile d'écraser un fichier
La concaténation finale devait être assez facile en utilisant la
commande aussi la commande cat... S'il y a beaucoup de fichiers à
traiter, les commandes shell paraissent plus rapides.
--SCRIPT
set FolderPath to ((path to desktop as string) & "Dossier_test")
set L to list folder (FolderPath) without invisibles
repeat with i in L
set thisFile to (FolderPath & ":" & i) as string -- Path to file
set ThePath to (POSIX path of file thisFile)
set cmd1 to "echo " & (quoted form of i as string) & " > /tmp/
Temporary_file" -- cree un fichier temporaire et ecrit i au début
set cmd2 to "cat " & quoted form of ThePath & " >> /tmp/
Temporary_file"
set cmd3 to "cat /tmp/Temporary_file > " & quoted form of ThePath
set cmd4 to "rm /tmp/Temporary_file"
do shell script cmd1 --cree un fichier temporaire et ecrit i
do shell script cmd2 --ajoute au fichier temporaire le contenu du
fichier d'origine
do shell script cmd3 --transfère le contenu du fichier temporaire
dans le fichier d'origine
do shell script cmd4 --supprime le fichier provisoire
end repeat
--SCRIPT
_______________________________________________
Applescript_fr mailing list
Applescript_fr@???
http://listes.patpro.net/mailman/listinfo/applescript_fr