• 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: osxutils and accented chars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: osxutils and accented chars


  • Subject: Re: osxutils and accented chars
  • From: KOENIG Yvan <email@hidden>
  • Date: Sat, 18 Nov 2006 14:47:21 +0100

Oops, I made an error in my late script.
I was concentrated to its behaviour when the folder to treat wasn’t on the boot volume and failed to check what it does when it is on the boot volume.

This oddity is now corrected but the icon is no longer displaid.


 --[SCRIPT colle_icone_v5_2]
 (* utilise osxutils  
 with a workaround for accented chars*)

 

 on run
 open ((choose file) as list)
 end run

 

 on open (sel)
 local tName, f, coF, nocoF, tStorage, tempCof, _
 tell application "Finder"
 set f to (sel's item 1) as alias (*
 grab source file path *)
 set coF to (container of f) as alias (*
 grab path of container of source file *)

 

 set {nocoF, tName} to {name of coF, "osxutils_slituxso"}

 

 try
 set extF to name extension of f
 on error
 set extF to ""
 end try

 

 if extF is "" then
 set tFname to tName
 else
 set tFname to tName & "." & extF
 end if

 

 set tStorage to (path to temporary items ¬
 from user domain) as alias
 set tcoF to (tStorage as Unicode text) & tName
 if exists item tcoF then delete item tcoF
 set tcoF to (make folder at tStorage ¬
 with properties {name:tName}) as alias (*
 create a folder without 'accented' characters *)
 set tF to (duplicate f to tcoF) as alias (* duplicate the source file *)

 

 set name of tF to tFname (*
 rename it without 'accented' characters *)
 end tell -- to Finder 

 

 do shell script "/usr/local/bin/seticon " & quoted form of POSIX path ¬
 of tF & " " & quoted form of POSIX path of tcoF (*
 crée fichier icône dans le dossier intermédiaire 
 create icon file in the temp folder *)

 

 tell application "Finder" to update tcoF (*
 to reveal the icon *)

 

 set icN to "icon" & return
 set {ticN, utcoF} to {((tcoF as Unicode text) & icN), ¬
 (coF as Unicode text)}
 do shell script "ditto --rsrc " & quoted form of POSIX path of ticN & ¬
 " " & quoted form of POSIX path of utcoF (*
 copy the icon file into the original folder *)
 tell application "Finder" to update coF (*
 try to reveal the icon *)

 

 end open

 

 --[/SCRIPT]

Yvan KOENIG

 _______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden

References: 
 >osxutils and accented chars (From: KOENIG Yvan <email@hidden>)
 >Re: osxutils and accented chars (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Create a Text Clipping File?
  • Next by Date: Re: osxutils and accented chars
  • Previous by thread: Re: osxutils and accented chars
  • Next by thread: Re: osxutils and accented chars
  • Index(es):
    • Date
    • Thread