Re: Deleting characters
Re: Deleting characters
- Subject: Re: Deleting characters
- From: Hanaan Rosenthal <email@hidden>
- Date: Thu, 12 Feb 2004 12:37:32 -0500
Ian,
I didn't know of a script, that is, until I wrote one:
set theFolderPath to "path:to:folder:"
set listOfCharactersToDelete to {space, "/"}
repeat with theCharacter in listOfCharactersToDelete
deleteCharacterFromNameName((theCharacter as string), theFolderPath)
end repeat
on deleteCharacterFromNameName(theCharacter, theFolderPath)
tell application "Finder"
set fileList to name of every file of folder theFolderPath whose name
contains theCharacter
repeat with i from 1 to (count fileList)
set oldName to (item i of fileList)
set AppleScript's text item delimiters to theCharacter
set theTextItems to text items of oldName
set AppleScript's text item delimiters to ""
set newName to theTextItems as string
set name of file (theFolderPath & oldName) to newName
end repeat
end tell
end deleteCharacterFromNameName
Good luck,
Hanaan
On Feb 12, 2004, at 11:26 AM, Buttery, Ian wrote:
>
Hi,
>
>
Does anyone know of a script to delete "/" and spaces out of filenames
>
which reside in a particular folder and schedule this at certain times
>
through the day?
>
The scheduling is not a problem as I can do this with iDo.
>
>
regards,
>
>
Ian.
>
>
Ian Buttery
>
Publishing Database and Tech. Support Manager
>
Thomas Cook Tour Operations Ltd.
>
*: 01733 843514
>
*: email@hidden
>
>
>
***********************************************************************
>
*
>
Thomas Cook - The ultimate expert in leisure travel, visit us at
>
>
www.thomascook.com or tune in to Thomas Cook TV on Sky
>
Digital Channel 648 or ntl:home channel 857 or visit us at...
>
>
www.jmc.com www.tcsignature.com www.style-holidays.co.uk
>
www.neilson.co.uk www.club18-30.co.uk www.blueskyholidays.com
>
>
This email is confidential, may be legally privileged, and is for
>
the intended recipient only. Access, disclosure, copying,
>
distribution or reliance on any of it by anyone else is prohibited
>
and may be a criminal offence. Please delete if obtained in error.
>
Any views expressed in this message are those of the individual
>
sender, except where the sender specifically states them to be
>
the views of Thomas Cook UK Ltd.
>
>
***********************************************************************
>
***
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
>
>
--
Hanaan Rosenthal * Custom Flow Solutions
MEDIA AUTOMATION CONSULTING
401-487-2957 * email@hidden
* www.customflowsolutions.com *
be successful... ...work less.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.