• 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: Luther Fuller <email@hidden>
  • Date: Tue, 26 Jan 2010 09:36:36 -0600

On Jan 25, 2010, at 3:04 AM, Rowland McDonnell wrote:

tell application "TeXShop"
       repeat with this_document in documents
               set this_documentX to path of this_document as string
               set this_documentM to this_documentX
               tell application "Finder"
                       make new alias to POSIX file this_documentX
               end tell
       end repeat
end tell

I got a copy of TeXShop so I could test this. Here is a script that seems to do what want, according to your original script (above). (But, I'm not sure.)

set destination to alias "OS_X:Users:lutherfuller:Desktop:TeXShop aliases" -- a file system pointer
tell application "TeXShop"
repeat with this_document in documents
try
(POSIX file (path of this_document)) as alias -- another file system pointer
tell application "Finder" to make new alias file to the result at destination
-- creates an alias file in the destination folder
end try
end repeat
end tell

I had to use a 'try ... end try' block in case there was a new unsaved document window open which, of course, has no path. Now, we can discuss why this works, if there are further questions.

 _______________________________________________
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: Thomas Fischer <email@hidden>
References: 
 >Applescript and referring to a folder (From: Rowland McDonnell <email@hidden>)

  • Prev by Date: Determining Binary Type
  • Next by Date: Re: If/Then Statements
  • Previous by thread: Re: Applescript and referring to a folder
  • Next by thread: Re: Applescript and referring to a folder
  • Index(es):
    • Date
    • Thread