• 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: Applescript and referring to a folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript and referring to a folder


  • Subject: Re: Applescript and referring to a folder
  • From: "Mark J. Reed" <email@hidden>
  • Date: Tue, 26 Jan 2010 07:15:39 -0500

On Tue, Jan 26, 2010 at 6:51 AM, Rowland McDonnell
<email@hidden> wrote:
> What I got working myself looked like this - in terms of identifying and
> selecting the file system objects I'm working with.
>
> tell application "Finder"
>  if not (exists folder "TeXShop_aliases_test" of home) then
>    make new folder at home with properties {name:"TeXShop_aliases_test"}
>  end if
>  set selected_folder to folder "TeXShop_aliases_test" of home
> end tell
>
> tell application "TeXShop"
>  repeat with this_document in documents
>
>    tell application "Finder"
>      set this_documentF to this_document

OK, so what you have in "this_document" is a TeXShop document object.
It's not a file object, alias, or anything else having to do with the
file system.  So you'll have to look at what the TeXShop dictionary
provides; you may be able to get the associated document file as an
alias directly.  Maybe "set this_documentA to this_document as alias"
will even work.  It just depends on TeXShop.

> tell application "Finder"
>     set this_documentF to this_document
>  end tell

Wrapping the assignment in a tell block doesn't change its meaning;
this_documentF and this_document wind up identical.

> set this_documentX to path of this_document as string

That is currently where you're going from TeXShop's idea of a
"document" back to something that has to do with the filesystem.

--
Mark J. Reed <email@hidden>
 _______________________________________________
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: Applescript and referring to a folder
      • From: Rowland McDonnell <email@hidden>
References: 
 >Re: Applescript and referring to a folder (From: "Mark J. Reed" <email@hidden>)
 >Re: Applescript and referring to a folder (From: Rowland McDonnell <email@hidden>)

  • Prev by Date: Re: Applescript and referring to a folder
  • Next by Date: Re: Applescript and referring to a folder
  • Previous by thread: Re: Applescript and referring to a folder
  • Next by thread: Re: Applescript and referring to a folder
  • Index(es):
    • Date
    • Thread