Re: error -1700
Re: error -1700
- Subject: Re: error -1700
- From: John <email@hidden>
- Date: Sun, 11 Nov 2012 21:57:10 -0500
Is it just me or is no one clear about what Robert is trying to accomplish with this script? Robert, what are you trying to accomplish with the script?
On Sun, Nov 11, 2012 at 6:45 PM, Jonathan Levi
<email@hidden> wrote:
I'm not sure I've read the problem correctly, either, but if you want a list of pathnames of a Finder window's items, try:
tell
application
"Finder" to
set
dirPathM
to
((folder
of
front
window)
as
string)
set
dirPathUQ
to
quoted
form
of
POSIX
path
of
dirPathM
set
itemPathList
to
paragraphs
of
(do
shell script
("ls " & dirPathUQ))
--use "ls
-a "instead of "ls "for invisible items
repeat
with
i
from
1 to
(count
items
of
itemPathList)
set
item
i
of
itemPathList
to
(dirPathM
& item
i
of
itemPathList)
end
repeat
Jonathan
-----Original Message-----
From: Luther Fuller <
email@hidden>
To: Applescript Users <
email@hidden>
Sent: Sun, Nov 11, 2012 4:29 pm
Subject: Re: error -1700
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.
_______________________________________________
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
_______________________________________________
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