--[SCRIPT]
--"Macintosh HD:Applications:TextEdit.app:Contents:Resources:French.lproj:Edit.nib:"
set theString to my getMenuName("TextEdit.app", "French.lproj/Edit.nib", 537, true)
display dialog theString
--"Macintosh HD:Applications:iWork '09:Numbers.app:Contents:Resources:French.lproj:Numbers.nib:"
set theString to my getMenuName("iWork '09/Keynote.app", "French.lproj/Keynote.nib", 123, false)
on getMenuName(a, f, n, tf)
local linefeed, balise, leFichier, textDatas, enliste, r
set linefeed to ASCII character (10)
set balise to "<key>CF$UID</key>" & linefeed & tab & tab & tab & tab & "<integer>" & n & "</integer>" & linefeed & tab & tab & tab & "</dict>" & linefeed & tab & tab & "</dict>" & linefeed & tab & tab & "<string>"
do shell script "plutil -convert xml1 -o edit.plist /Applications/" & a & "/Contents/Resources/" & f & "/keyedobjects.nib"
if tf then
set leFichier to (path to startup disk as text) & "edit.plist"
set textDatas to read file leFichier
set enliste to my decoupe(textDatas, balise)
if (count of enliste) = 2 then
set r to item 1 of my decoupe(item 2 of enliste, "</string>")
else
set r to false
end if
tell application "System Events" to delete file leFichier
return r
end if
end getMenuName
--=====
on decoupe(t, d)
local l
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=====
--/[SCRIPT]
do shell script "plutil -convert xml1 -o edit.plist /Applications/iWork '09/Keynote.app/Contents/Resources/French.lproj/Keynote.nib/keyedobjects.nib"
"sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file"
Yvan KOENIG (from FRANCE vendredi 10 juillet 2009 11:36:07)