Highlighted

AppleScript - Folders and SubFolders --> INDD Count and Name

Enthusiast ,
Aug 26, 2020

Copy link to clipboard

Copied

Dear All,

 

My request is, user has to select the Main Folder, but the script loop via sub folders and get the InDD file name, count etc..

 

So far, I got the script for the Main Folder InDesign Count only.

 

Any help is very appreciable..

 

tell application "Finder"
	set theList to files of folder (choose folder) whose name extension is in {"indd", "INDD", "idml", "IDML"}
	length of theList
end tell

 

 

 

Adobe Community Professional
Correct answer by rob day | Adobe Community Professional

Try this:

 

 

set mainFolder to choose folder "Select a Main folder"


tell application "Finder"
	set listOfFolder to (every folder of entire contents of folder mainFolder) whose name is not "ABCD"
	
	set theList to {}
	repeat with i in listOfFolder
		set theInddList to ((every file of i) whose name extension is in {"indd", "INDD"})
		repeat with x in theInddList
			copy x as alias to the end of theList
		end repeat
	end repeat
	
	get theList
	--{alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER A:IDFILEA.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER B:IDFILEC.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER B:IDFILED.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER A:FOLDER C:IDFILEB.indd"}
end tell

 

 

 

Screen Shot 1.png

TOPICS
Scripting

Views

91

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

AppleScript - Folders and SubFolders --> INDD Count and Name

Enthusiast ,
Aug 26, 2020

Copy link to clipboard

Copied

Dear All,

 

My request is, user has to select the Main Folder, but the script loop via sub folders and get the InDD file name, count etc..

 

So far, I got the script for the Main Folder InDesign Count only.

 

Any help is very appreciable..

 

tell application "Finder"
	set theList to files of folder (choose folder) whose name extension is in {"indd", "INDD", "idml", "IDML"}
	length of theList
end tell

 

 

 

Adobe Community Professional
Correct answer by rob day | Adobe Community Professional

Try this:

 

 

set mainFolder to choose folder "Select a Main folder"


tell application "Finder"
	set listOfFolder to (every folder of entire contents of folder mainFolder) whose name is not "ABCD"
	
	set theList to {}
	repeat with i in listOfFolder
		set theInddList to ((every file of i) whose name extension is in {"indd", "INDD"})
		repeat with x in theInddList
			copy x as alias to the end of theList
		end repeat
	end repeat
	
	get theList
	--{alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER A:IDFILEA.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER B:IDFILEC.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER B:IDFILED.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER A:FOLDER C:IDFILEB.indd"}
end tell

 

 

 

Screen Shot 1.png

TOPICS
Scripting

Views

92

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 26, 2020 0
Adobe Community Professional ,
Aug 26, 2020

Copy link to clipboard

Copied

Try this:

 

tell application "Finder"
	set the theFolder to (choose folder with prompt "Choose a folder.")
	set theList to (every file of entire contents of folder theFolder) whose name extension is in {"indd", "INDD", "idml"}
	get length of theList
end tell

 

 

You might need a timeout line, the user could choose a folder with 1000s of sub folders and files

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Enthusiast ,
Sep 02, 2020

Copy link to clipboard

Copied

Hi Rob,

 

Sorry for the delayed response.. I will check and get back to you...

 

Thanks in Advance..

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 02, 2020 0
Enthusiast ,
Sep 17, 2020

Copy link to clipboard

Copied

Hi Rob/All,

 

Sorry for the very delayed response.. I was moved to some other urgent request.

 

Thats why, I'm not able to response for your reply..

 

I tested your code, it's working like a charm.

 

-------------------------------------------------------------------------

But our user modified the request slightly...

 

My new request is,

 

1. User has to select the Main Folder,

2. Script loop via all folders includes sub folder and get the InDD file name and Count 

3. But excludes or skip the INDD files in the folder name of "ABCD" (except this folder, we need the count)

 

Below code is developed so far, but I am not acheived my request.

 

 

set mainFolder to choose folder "Select a Main folder"


tell application "Finder"
	set listOfFolder to every folder of mainFolder
	display dialog (count of listOfFolder)
end tell


set theList to {}

repeat with i in listOfFolder
	set temp to the name of i
	
	if temp does not contain "ABCD" then
		set theArray to theList & temp
		--set theInddList to (every file of entire contents of folder listOfFolder) whose name extension is in {"indd", "INDD"}   --Error Found Here
	end if
end repeat

 

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2020 0
Adobe Community Professional ,
Sep 17, 2020

Copy link to clipboard

Copied

Try this:

 

 

set mainFolder to choose folder "Select a Main folder"


tell application "Finder"
	set listOfFolder to (every folder of entire contents of folder mainFolder) whose name is not "ABCD"
	
	set theList to {}
	repeat with i in listOfFolder
		set theInddList to ((every file of i) whose name extension is in {"indd", "INDD"})
		repeat with x in theInddList
			copy x as alias to the end of theList
		end repeat
	end repeat
	
	get theList
	--{alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER A:IDFILEA.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER B:IDFILEC.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER B:IDFILED.indd", alias "Fishercat OSX:Users:fishercat:Desktop:TEST:FOLDER A:FOLDER C:IDFILEB.indd"}
end tell

 

 

 

Screen Shot 1.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 17, 2020 0
Enthusiast ,
Sep 18, 2020

Copy link to clipboard

Copied

Hi Rob,

 

Thank you so much for your timely help...

 

You are my AppleScript Heroooo!! Works like a charm.

 

I will try the remaining part of the Automation by using your code.

 

Again Thanks a lot!

 

SS

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2020 0