Bonjour
en lisant les différents messages sur ce forum je viens de mettre ce code dans apple script pour qu'il me fasse un fichier texte avec les fichiers qui se trouve dans un dossier et ce QUELQUE soit le type de fichier, je souhaite voir les sous-dossiers et tous les fichiers qui s'y trouvent
	
	
	
		
j'ai cette erreur 
si vous pouvez m'aider

MERCI
---------- Nouveau message ajouté à 08h05 ---------- Le message précédent a été envoyé à 06h35 ----------
ha j'ai trouvé un autre début de solution
je le mets car cela peut répondre à la demande de quelqu'un d'autre
	
	
	
		
Ca fonctionne mais moi je voudrais aussi les dossiers et sous-dossiers en retrait et les fichiers qu'ils contiennent  bref comme un sitemap
avec un présentation... ben oui quand même on est en 2012 lol
quelqu'un sait ?
---------- Nouveau message ajouté à 08h39 ---------- Le message précédent a été envoyé à 08h05 ----------
ha j'ai trouvé un super script ici
	
	
	
		
Ca marche nickel manque plus que..les noms de dossiers en gras etc
c'est possible des mises en forme sur Applescript ?
Merci
	
		
			
		
		
	
				
			en lisant les différents messages sur ce forum je viens de mettre ce code dans apple script pour qu'il me fasse un fichier texte avec les fichiers qui se trouve dans un dossier et ce QUELQUE soit le type de fichier, je souhaite voir les sous-dossiers et tous les fichiers qui s'y trouvent
		Bloc de code:
	
	-- CRÉATION FICHIER LISTING .doc D'UN DOSSIER
-- créé le 12 Janvier 2011, testé avec Léopard 10.5.8
set votreChoix to choose folder
set listeNoms to ""
tell application "Finder"
	set liste_Fichiers to every file of entire contents of folder (votreChoix as alias)
	
	if (count liste_Fichiers) is not 0 then -- Si trouve aucun .doc, passe (évite de créer un fichier vide)
		
		repeat with i from 1 to (the count items of liste_Fichiers)
			-- \\\ LISTE DES NOMS DE FICHIERS .doc SEULEMENT /// --
			set nom to name of item i of text items of liste_Fichiers as text
			set listeNoms to listeNoms & nom & return
		end repeat
		
		-- Création du fichier si il n'existe pas dans le dossier sélectionné
		-- en premier dans le dossier (le nom commence par le caractère espace)
		
		try
			set chemin_Fichier to open for access chemin_Fichier with write permission
			set eof chemin_Fichier to 0 -- Pour éffacer le contenu du fichier
			write listeNoms starting at eof to chemin_Fichier
			close access chemin_Fichier
		on error
			close access chemin_Fichier
		end try
		
	end if
end tell
	là je sèche ... :mouais:error "La variable chemin_Fichier n’est pas définie." number -2753 from "chemin_Fichier"
si vous pouvez m'aider
MERCI
---------- Nouveau message ajouté à 08h05 ---------- Le message précédent a été envoyé à 06h35 ----------
ha j'ai trouvé un autre début de solution
je le mets car cela peut répondre à la demande de quelqu'un d'autre
		Bloc de code:
	
	set votreChoix to choose folder
tell application "Finder"
	
	-- Create text file on desktop to write filenames to
	make new file at desktop with properties {name:"theFile.txt"}
	set theFile to the result as alias
	set openFile to open for access theFile with write permission
	
	-- Read file names and write to text file
	set theFiles to every item of folder votreChoix
	repeat with i in theFiles
		set fileName to name of i
		write fileName & "
" to openFile starting at eof
	end repeat
	
	close access openFile
	
end tell
	avec un présentation... ben oui quand même on est en 2012 lol
quelqu'un sait ?
---------- Nouveau message ajouté à 08h39 ---------- Le message précédent a été envoyé à 08h05 ----------
ha j'ai trouvé un super script ici
		Bloc de code:
	
	-- Create the text to be written to the file.
-- Just a heading and the item names, indented according to their positions in the hierarchy.
-- (Uncomment the (* *) comment markers to preserve the full paths.)
on createText(posixPaths)
	script o
		property paths : posixPaths
	end script
	
	set rootPath to beginning of o's paths
	set item 1 of o's paths to "Entire contents of " & rootPath & linefeed
	set astid to AppleScript's text item delimiters
	-- (*
	considering case
		set AppleScript's text item delimiters to ""
		set tabStr to {tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab, tab} as text -- Hopefully more than needed!
		
		set AppleScript's text item delimiters to "/"
		set nonIndent to (count rootPath's text items) -- 1
		
		set len to (count posixPaths)
		repeat with i from 2 to len
			set thisPath to item i of o's paths
			set tiCount to (count thisPath's text items)
			set thisName to text item -1 of thisPath
			-- If the item name contains any colons, restore the original slashes.
			if (thisName contains ":") then
				set AppleScript's text item delimiters to ":"
				set thisName to thisName's text items
				set AppleScript's text item delimiters to "/"
				set thisName to thisName as text
			end if
			-- If this is a folder path, append a colon to the name.
			if ((i < len) and (item (i + 1) of o's paths begins with thisPath)) then set thisName to thisName & ":" -- or "/", if preferred.
			set item i of o's paths to text 1 thru (tiCount - nonIndent) of tabStr & thisName
		end repeat
		-- *)
		set AppleScript's text item delimiters to linefeed
		set outText to o's paths as text
		-- (*
		set AppleScript's text item delimiters to linefeed & tab
		set outText to outText's text items
		set AppleScript's text item delimiters to linefeed
		set outText to outText as text
	end considering
	-- *)
	set AppleScript's text item delimiters to astid
	
	return outText
end createText
-- Write the text to file as UTF-8.
on writeTextFile(txt, defaultLoc)
	set f to (choose file name with prompt "Save the UTF-8 text listing as…" default name (paragraph 1 of txt) & ".txt" default location defaultLoc)
	set fRef to (open for access f with write permission)
	try
		set eof fRef to 0
		write «data rdatEFBBBF» to fRef -- UTF-8 BOM.
		write txt as «class utf8» to fRef
	end try
	close access fRef
	
	display dialog "The listing has been saved in file \"" & f & "\"" buttons {"OK"} default button 1
end writeTextFile
on main()
	set rootFolder to (choose folder with prompt "Choose a folder or disk to catalogue…")
	
	-- List the hierarchy as POSIX paths, omitting any that contain elements beginning with ".".
	set thePaths to paragraphs of (do shell script "find -f " & (quoted form of POSIX path of rootFolder) & " \\! -path \"*/.*\"")
	
	set outText to createText(thePaths)
	writeTextFile(outText, (path to documents folder))
end main
main()
	c'est possible des mises en forme sur Applescript ?
Merci
			
				Dernière édition: