List with single values
List with single values
- Subject: List with single values
- From: John Haley <email@hidden>
- Date: Tue, 24 Jul 2001 08:40:48 -0500
I wish to thank the list for giving me the courage to try and write a real
applescript for the first time. Before I subscribe to the list I only tried
to do very simple things.
But now that I am trying to write a real script I have run across a problem
I know I have seen discussed but I can't seem to find/recall the solution. I
am having a problem where a variable in a loop is usually a list but can be
a single item. It crashes the script every time it hits a single value.
What is the work around for this??
This is what I have been playing with:
tell application "Finder"
set folderCount to number of folders in (alias loopPathName)
end tell
if folderCount > 0 then
tell application "Finder"
if folderCount > 1 then
set foldersList to name of every folder of (alias
loopPathName)
display dialog folderList & "list"
else
set foldersList to name of folder of (alias loopPathName)
display dialog folderList & "not list"
end if
set folderNameHolder1 to (loopPathName as string)
end tell
repeat with folderLoopName in foldersList
tell application "Finder"
set folderLoopNameHolder to item itemNum of foldersList
display dialog folderLoopNameHolder
set folderNameHolder2 to folderNameHolder1 &
folderLoopNameHolder & ":"
moveToNewFolder(folderNameHolder2, pictApend, newFolder,
newPath) of me
end tell
end repeat
end if
Thanks for any help/suggestions.