My name’s François, needs help with script
the script within wont copy or move the pictures of subfolder to “Catalogue photo,fp7”
I’ve tried differeent options without succes, is it possible to have some help with the following sript
–Getiphotoimage - with two loops
set UserName to “UserName”
set FolderName to “iPhoto”
set xImage to “”
– Opens required apps.
tell application “Finder” to open file “Catalogue photo.fp7_JP-1”
– Opening principal directory
tell application “Finder”
activate
open folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– Obtaining numbers of folders (sub folders) of principal repertory
set DirCount to count folders of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
set d to 1
end tell
– Principal loop - to obtain folders - SubFolderName = folders
repeat until d > DirCount
tell application “Finder”
activate
set SubFolderName to name of folder d of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– Opening subfolders
open folder SubFolderName of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– Obtaining number of documents
set DocCount to count files of folder SubFolderName of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
set i to 1
set DocName to name of first file of folder SubFolderName of folder FolderName of folder “Desktop” of folder UserName of folder “Users” of startup disk
– delete extension name (.jpg)
set CharCount to count every character of DocName
set DocName to characters 1 thru {CharCount - 4} of DocName
set DocName to DocName as text
end tell
-- Secondary loop to extract data from document
repeat until i > DocCount
tell application "Finder"
activate
set DocName to name of file i of folder SubFolderName of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk
end tell
tell application "Finder" to open file i of folder SubFolderName of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk
--Obtaining data from folder iPhoto
set Folder to SubFolderName
set ID_ to DocName
-- tell application "QuickTime Player"
tell application "Preview"
activate
-- set Image to xImage
set Image to document
end tell
--set picture to gImage
-- Activatng FileMaker Pro to pass parameters to reaserch & change data
tell application "FileMaker Pro"
activate
set field "gID" of current record to ID_ -- replace "text"
set field "gDossier" of current record to Dossier -- replace "text"
set field "gImage" of current record to xImage -- replace "multimedia"
-- Execute FileMaker script: "Recherche Image et colle Image"
do script "Recherche Image et colle Image"
end tell
--Reactivate QuickTime Player & close front window
tell application "QuickTime Player"
activate
close front window
end tell
-- change la couleur du document une fois le processus terminé --Changes document colour once done
tell application "Finder" to set label index of file i of folder SubFolderName of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk to 4 -- bleu
-- Pour activer le prochain document de la série -- Activate following document of series
set i to i + 1
tell application "Finder"
activate
end tell
end repeat
-- change la couleur de la chemise une fois le processus terminé --Changes folder colour once process done
tell application "Finder" to set label index of folder d of folder FolderName of folder "Desktop" of folder UserName of folder "Users" of startup disk to 2 -- rouge
-- passe au prochain réprtoire
set d to d + 1
tell application "Finder"
activate
close front window
end tell
end repeat
Thanks in advance for your help
Model: Powerbook G4
AppleScript: 2.0 (v43.1)
Browser: Safari 312.6
Operating System: Mac OS X (10.3.9)