0

So this is the shell script that I have in my Applescript editor which brings up all of the videos that have been added to my computer today.

do shell script "mdfind 'kMDItemDateAdded >= $time.today && kMDItemKind = *movie'"

I see four videos show up in the results section of the Appliscript editor. But I am having difficultly changing those results into an alias list and sending them into a folder called "New Videos".

Can anybody show me how this is done?

4
  • apple.stackexchange.com/questions/278117/…
    – anki
    Commented Dec 15, 2019 at 18:23
  • Thank you for taking the time to respond. But the link you posted is for just one file. I want each of the four movies that show up in my results section to be an alias. I do not want to manually convert each one. I want it to be automatic for all all four.
    – David
    Commented Dec 15, 2019 at 19:51
  • Do you want to move the actual movie files into the new videos folder or are you looking to create aliases to those files and move the aliases to the new videos folder?
    – wch1zpink
    Commented Dec 15, 2019 at 19:59
  • I want to move the movie files to the new videos folder. It was my mistake that I did not specify that when I mean alias, I do not mean a link to the file. I mean set the path of each movie file that shows up in my Apple script editor results section to an "An alias file".
    – David
    Commented Dec 15, 2019 at 20:01

1 Answer 1

0

Let’s assume that your new videos folder is located on your desktop. This AppleScript code does not create an alias list. The list created will be Posix paths.

property moveToFolder : POSIX path of ((path to desktop as text) & "New Videos" as alias)

set fileList to do shell script "mdfind 'kMDItemDateAdded >= $time.today && kMDItemKind = *movie'"

set fileList2 to paragraphs of fileList

repeat with thisMovie in fileList2
    tell application "System Events"
        move disk item thisMovie to folder moveToFolder
    end tell
end repeat
1
  • Thank so much. It could have not been simpler. I will try to be more specific next time.
    – David
    Commented Dec 15, 2019 at 20:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .