• 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: Sending an image as attachment in Mail.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending an image as attachment in Mail.


  • Subject: Re: Sending an image as attachment in Mail.
  • From: Ron Hunsinger <email@hidden>
  • Date: Sun, 25 Mar 2012 15:13:21 -0700


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
 _______________________________________________
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: Sending an image as attachment in Mail.
      • From: Luther Fuller <email@hidden>
References: 
 >Sending an image as attachment in Mail. (From: Manuel <email@hidden>)

  • Prev by Date: Re: Sending an image as attachment in Mail.
  • Next by Date: Re: Sending an image as attachment in Mail.
  • Previous by thread: Re: Sending an image as attachment in Mail.
  • Next by thread: Re: Sending an image as attachment in Mail.
  • Index(es):
    • Date
    • Thread