• 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: Stack Overflow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack Overflow


  • Subject: Re: Stack Overflow
  • From: Yvan KOENIG <email@hidden>
  • Date: Sat, 19 Dec 2015 21:11:36 +0100

I ran this modified version with no problem.

tell application "Finder"
activate
delay 0.2
beep
set myName to "" # clear myName
try # Deal with All Conditions Met, Execute Actions with no selection
set theSelection to the selection
if class of theSelection is list then
set myFile to (item 1 of theSelection) as alias
else
set myFile to theSelection as alias
end if
set myName to the name of myFile
display dialog "myFile = " & myFile & return & "myName = " & myName
end try


if myName contains "ƒ" then set myName to "" # don't add "ƒ" if it's already there
if length of myName ≠ 0 then # length of name of file selected
set the name of myFile to myName & "ƒ"
end if
end tell # to Finder

delay 0.2

if length of myName = 0 then
tell application "Finder" to activate # re-activate Finder, so Keyboard Maestro macro will respond
delay 0.1
tell application "System Events" to tell process "Finder"
set frontmost to true
keystroke "a" using {option down, command down} # deselect all
delay 0.2
# I apologize, as I don't know this shortcut, I disabled it !
-- keystroke "q" using {option down} # activate open finder 2
end tell
end if # length of myName


Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) samedi 19 décembre 2015 21:10:35




 _______________________________________________
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

  • Follow-Ups:
    • Re: Stack Overflow
      • From: Robert Poland <email@hidden>
References: 
 >Stack Overflow (From: Robert Poland <email@hidden>)

  • Prev by Date: Postscript, and one for the annals of "Be careful what you wish for..."
  • Next by Date: Re: AS Library Question
  • Previous by thread: Re: Stack Overflow
  • Next by thread: Re: Stack Overflow
  • Index(es):
    • Date
    • Thread