Re: how to make a Finder Service using Automator and an Applescript
Re: how to make a Finder Service using Automator and an Applescript
- Subject: Re: how to make a Finder Service using Automator and an Applescript
- From: Bob Stern <email@hidden>
- Date: Tue, 10 Oct 2017 13:36:09 -0700
If you haven’t yet learned AS ObjC, here’s a solution in plain old AppleScript.
--Bob Stern
tell application "Finder" to set mySel to selection --List
repeat with myFile in mySel
tell application "Finder"
set extension hidden of myFile to false
copy name of myFile to myName
end tell
set myName to ReplaceChar(myName, " ", “-")
tell application "Finder" to set name of myFile to myName
end repeat
on ReplaceChar(oldString, old, new)
set AppleScript's text item delimiters to old
set TextItemList to text items of oldString
set AppleScript's text item delimiters to new
set x to TextItemList as string
set AppleScript's text item delimiters to {""}
set result to x
end ReplaceChar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden