🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #525

js Is it possible to change file names of the folder with ES (like with AS)

#525
From: erkki_pennanen
Date: Thu, 12 Mar 2009 21:06
19 lines
1146 bytes
Hi,

Does anyone know how to change every file name of the selected folder using ExtendScript? ... or is it possible?

eg like below:

set fol to choose folder
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to "_"
tell application "Finder"
	repeat with apf in (get every file in entire contents of fol)
		set old_name to every word of (apf's name as text)
		set apf's name to ((old_name as text) & ".jpg")
	end repeat
end tell
set AppleScript's text item delimiters to astid

regards
Erkki
Technical Details
Message-ID: <59b83248.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,2c3ecbb9af1c5b43,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: erkki_pennanen@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: js Is it possible to change file names of the
 folder with ES  (like with AS)
Message-ID: <59b83248.-1@webcrossing.la2eafNXanI>
Date: Thu, 12 Mar 2009 14:06:53 -0700
Lines: 20
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit