• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to make a Finder Service using Automator and an Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >how to make a Finder Service using Automator and an Applescript (From: Alastair Leith <email@hidden>)

  • Prev by Date: Re: how to make a Finder Service using Automator and an Applescript
  • Next by Date: High Sierra ?
  • Previous by thread: Re: how to make a Finder Service using Automator and an Applescript
  • Next by thread: High Sierra ?
  • Index(es):
    • Date
    • Thread