Copier et renommer fichier avec Applescript
HAL
-
HAL -
HAL -
Bonjour,
Je voudrais pouvoir copier un fichier depuis un dossier dans un dossier que j'ai créé et renommer le fichier copié (pas l'original) avec un nom contenu dans le clipboard.
j'ai essayé ça mais les deux fichiers sont renommés:
set OFormat to (cellValue of cell "Format") as string
set nomTitle to (cellValue of cell "Title") as string
set OFR to (cellValue of cell "Original Frame Rate") as string
set NUMREEL to (cellValue of cell "ReelNumber") as string
set NomReel to "REEL"
set DossierOriginaux to "ORIGINAUX"
tell application "Finder"
set monfichier to choose file
set NewName to (nomTitle &"_MIX_MULTI_"& OFormat &"_PAR_"& OFR &"_REEL"& NUMREEL &".C.wav")
set the name of monfichier to NewName
set monDossier to folder (nomTitle &"_"& DossierOriginaux &"_MIX_MULTI_"& OFormat &"_"& OFR &"_REEL"& NUMREEL) of folder (nomTitle &"_"& DossierOriginaux &"_MIX_MULTI_"& OFormat &"_"& OFR) of folder (nomTitle &"_"& DossierOriginaux &"_"& OFormat &"_"& OFR) of folder nomTitle of desktop
duplicate monfichier to monDossier
set the clipboard to NewName
end tell
Merci de votre aide!!
Je voudrais pouvoir copier un fichier depuis un dossier dans un dossier que j'ai créé et renommer le fichier copié (pas l'original) avec un nom contenu dans le clipboard.
j'ai essayé ça mais les deux fichiers sont renommés:
set OFormat to (cellValue of cell "Format") as string
set nomTitle to (cellValue of cell "Title") as string
set OFR to (cellValue of cell "Original Frame Rate") as string
set NUMREEL to (cellValue of cell "ReelNumber") as string
set NomReel to "REEL"
set DossierOriginaux to "ORIGINAUX"
tell application "Finder"
set monfichier to choose file
set NewName to (nomTitle &"_MIX_MULTI_"& OFormat &"_PAR_"& OFR &"_REEL"& NUMREEL &".C.wav")
set the name of monfichier to NewName
set monDossier to folder (nomTitle &"_"& DossierOriginaux &"_MIX_MULTI_"& OFormat &"_"& OFR &"_REEL"& NUMREEL) of folder (nomTitle &"_"& DossierOriginaux &"_MIX_MULTI_"& OFormat &"_"& OFR) of folder (nomTitle &"_"& DossierOriginaux &"_"& OFormat &"_"& OFR) of folder nomTitle of desktop
duplicate monfichier to monDossier
set the clipboard to NewName
end tell
Merci de votre aide!!
2 réponses
-
Bonjour,
Je n'ai pas la solution pour ton code, mais je voulais juste te dire qu'Il y a un petit outil qui le fait: Renamer
Ritchi -
Merci Ritchi,
Le problème étant que le script appaartient à un script plus gros et qui effectue d'autres taches j'aimerai donc pouvoir l'intégrer totalement dans le script...