i'm using Ubuntu && MAC OS/X. i'm trying to achive a random order in finder or nautilus.
someone can get me some advice? i am open to any kind of solutions, shell script or applescript, whatever, but i think there would be something easier.
till now i have renamed files with random names and order it alphabetically but i'm looking for something that does preserve the real names.
22 Answers
If you need a graphical file manager to sort the files randomly you will probably HAVE to change the file names. File managers are just not made for this kind of functionality. To "preserve" the file names you could just create links with random names in a new directory that link back to the originals:
find . -type f | while read n; do \ ln -s `pwd`/"$n" new_dir/`head /dev/urandom | tr -dc A-Za-z | head -c8`; \
done You could also modify some other attributes like modification dates.
do shell script "for f in ~/Desktop/*; do
touch -t $(($RANDOM % 8000 + 2000))01010000 \"$f\"
done"
tell application "Finder" open (desktop as alias) tell Finder window 1 set current view to list view set sort column of its list view options to modification date column end tell
end tellFinder doesn't see comments added by xattr -w com.apple.metadata:kMDItemFinderComment. I don't know any way to set the versions of files.