Hi, I do hope someone out there knows how to do this… Im creating an applescript that will get the name of every item in a folder, then save the result in a text file, then retrieve this text back into a variable and then use this text as the original variable before exporting the data, just like nothing happened. unfortunatly I get a lot of errores doing this… here is the script:
tell application "Finder"
set FileNames to name of every item of folder "MyDocuments" of folder "Desktop" of disk "brian"
set theFilePath to "brian:desktop:thelist.txt"
-------------------------------------------------------------
try
set XXXXX to open for access theFilePath with write permission
write FileNames to XXXXX
close access XXXXX
on error errstr number errNum
if errNum = -49 then
close access XXXXX
set XXXXX to open for access theFilePath with write permission
write FileNames to XXXXX
close access XXXXX
else
tell current application
activate
display dialog errstr
return false
end tell
end if
end try
delay 2
-------------------------------------------------------------
--lots and lots of stuff
-------------------------------------------------------------
try
set XXXXX to open for access theFilePath with write permission
set FileNames to (read theFilePath)
close access XXXXX
on error errstr number errNum
if errNum = -49 then
close access XXXXX
set XXXXX to open for access theFilePath with write permission
set FileNames to (read theFilePath)
close access XXXXX
else
tell current application
activate
display dialog errstr
--return false
end tell
end if
end try
-------------------------------------------------------------
set X to count of every item in FileNames
repeat with i from 1 to X
set W to item i of X
-------------------------------------------------------------
--lots and lots of stuff
-------------------------------------------------------------
end repeat
end tell
Any idea will be most appreciated
Brian