• 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: error -1700
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error -1700


  • Subject: Re: error -1700
  • From: "koenig.yvan" <email@hidden>
  • Date: Sun, 11 Nov 2012 22:45:23 +0100


Le 11/11/2012 à 22:28, Luther Fuller <email@hidden> a écrit :

I'm not sure I've read the problem correctly or understand it, but I did some experimenting with getting an alias list of the contents of a (target) folder using System Events. So, just in case there is a connection, I'm reporting the result of my experiment.

System Events can create a list of items in a folder, but this list seems to be un-usable …
(I felt like I was banging my head against a brick wall for about an hour)
UNTIL you discover System Events 'path' command.
I finally got this script which works:

tell application "Finder"
activate
set folderAlias to (target of window 1) as alias
end tell
set itemAliasList to my getItemAliasList(folderAlias)
set AppleScript's text item delimiters to {return}
log itemAliasList as text

on getItemAliasList(folderAlias)
tell application "System Events"
set itemList to (every item of disk item (folderAlias as text))
repeat with i from 1 to (count items of itemList)
(path of (item i of itemList)) as alias
set item i of itemList to the result
end repeat
end tell
return itemList
end getItemAliasList

The list itemList contains aliases to every folder and file in the target folder including invisible items.


Why aren’t you using :

tell application "System Events"
set itemList to path of disk items of folder (folderAlias as text)
end tell

This simple piece of code return a list of HFS pathnames.

Yvan KOENIG (VALLAURIS, France) dimanche 11 novembre 2012 22:45:17



 _______________________________________________
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: error -1700
      • From: Luther Fuller <email@hidden>
References: 
 >error -1700 (From: Robert Poland <email@hidden>)
 >Re: error -1700 (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: error -1700
  • Next by Date: Re: error -1700
  • Previous by thread: Re: error -1700
  • Next by thread: Re: error -1700
  • Index(es):
    • Date
    • Thread