• 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: Fri, 17 Nov 2006 12:23:38 +0100

Hello

I am trying to use seticon from the osxutils to give a folder the icon of an embedded file.

All would be easy if seticon was able to deal with 'accented' characters but alas it doesn't.

I coded a first workaround copying the entire folder in the temporay folder and renaming folder and file with a non-accented name.
It works but if the folder contains several files, it is time consuming.


Now, I try to copy the source file in a temporary folder, create the icon file then move it to the original folder.

It is quite OK but alas, the copied icon file is not displaid (it is correctly treated in the temp folder).

May you give an explanation or even a soluce to this oddity ?

--[SCRIPT colle_icone_v5]
(* 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"}

		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 (move F to tcoF) as alias (* move the source file *)
		set name of tF to tName (*
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, nicN} to {((tcoF as Unicode text) & icN) as alias, ¬
		((coF as Unicode text) & icN) as alias}

	do shell script "cp -f " & quoted form of POSIX path of ticN & ¬
		" " & quoted form of POSIX path of nicN (*
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
  • Follow-Ups:
    • Re: osxutils and accented chars
      • From: KOENIG Yvan <email@hidden>
References: 
 >osxutils and accented chars (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: AppleScript Error
  • Next by Date: Re: Rename images (optional add comments)
  • Previous by thread: osxutils and accented chars
  • Next by thread: Re: osxutils and accented chars
  • Index(es):
    • Date
    • Thread