On Mar 25, 2012, at 10:39 AM, Manuel wrote: do shell script "screencapture /Users/macdiario/Desktop/Captura.jpeg" set CapturaAdjunta to "LionRetail:macdiario:Escritorio:Captura.jpeg"
You've used "Desktop" in one place, and "Escritorio" in the other.
When you switch to a different language, Finder will localize the names of various folders and applications, but it's important to note that only Finder is aware of this change. It's purely cosmetic, and only for the user's benefit. The names on disk do not change, and all applications other than Finder must refer to files/folders using their real, on-disk names. (That's why do shell script had to use Desktop.)
For example:
tell application "Finder" (alias "LionRetail:macdiario:Escritorio:captura.jpeg") as text end tell
--> returns "LionRetail:macdiario:Desktop:captura.jpeg"
Finder has un-localized "Escritorio" to "Desktop". But if you don't do it inside a tell application "Finder" block, the un-localization doesn't happen:
(alias "LionRetail:macdiario:Escritorio:captura.jpeg") as text
--> returns Error: No se ha encontrado el archivo alias LionRetail:macdiario:Escritorio:captura.jpeg ...
Using the real name ("Desktop" rather than "Escritorio") works everywhere, both inside and outside Finder tell blocks. It's also more reliable: if you have both a "Desktop" folder and an "Escritorio" folder (permitted since their on-disk names are different), Finder running in Spanish will show you two "Escritorio" folders, but if it sees a file path containing "Escritorio" it will look only in the folder actually named "Escritorio". It only tries substituting "Desktop" if it can't find "Escritorio".
-Ron Hunsinger |