Hi All,
I am trying to work on a script that reads a folders contents and puts it into a XML file so i can force Quicktime to que files to watch
Is there anyway of being able to get apple script to read a folder and then populate the following:
Hi All,
I am trying to work on a script that reads a folders contents and puts it into a XML file so i can force Quicktime to que files to watch
Is there anyway of being able to get apple script to read a folder and then populate the following:
Are you looking to get something like this? It lists a folder’s contents and makes an XML document of it containing all of it contents.
Script:
set myFolder to choose folder
set xmldata to {"<smil><body><seq>"}
set allfiles to list folder myFolder without invisibles
repeat with i in allfiles
set fullpath to (myFolder as text) & i
set end of xmldata to "<video src=\"file://" & POSIX path of fullpath & "\" />"
end repeat
set end of xmldata to "</seq></body></smil>"
xmldata as text
set filename to POSIX path of (choose file name default name "Untitled.xml")
do shell script "printf " & quoted form of (xmldata as text) & " > " & quoted form of filename
Hope it helps,
ief2
Cheers IEF2 - that was exactly what i was after Many Thanks