Hi, i’m trying to choose a file and copy it to my bundle resource folder.
One thing very important is also to get the name and extension of the choosen file
set myBundlePath to (current application's class "NSBundle"'s mainBundle()'s bundlePath())
set dossierBundleRessource to myBundlePath & ":Contents:Resources:" as string
tell application "Finder" -- permet de recuperer chemin et nom du fichier choisi
set choixFichierImageAgence to choose file with prompt "Merci de choisir le fichier bandeau !"
set nomFichierImageAgence to name of infoChoixImgAgence as string
set pathFichierImageAgence to path of infoChoixImgAgence as string
-- copy le fichier dans le bundle
move choixFichierImageAgence to dossierBundleRessource
end tell
It’s not recommended to copy files into the bundle because of two reasons. 1) Apple guidlines tells you not to use the application bundle as a ‘workspace’. 2) if the application is installed in applications folder then half of the users can’t even use your program (by default the application folder is read only for non-admin users).