Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I always wondered why skype don't put all my accepted downloads in subfolders with the name of my contacts!

If anybody have own solutions, share)

share|improve this question

1 Answer 1

So I made a script and saved it as a folder action:

for f in "$@"
do
    userFolder=~/Downloads/Skype/`xattr -p com.apple.metadata:kMDItemWhereFroms "$f" | sed -e 's/0D//g' -e 's/.*\(5F 10\)...//' -e 's/00.*//'| xxd -r -p | sed -e 's@ (.*@@g'`
    mkdir -p "$userFolder"
    mv "$f" "$userFolder"
done

What it does:

  1. gets where from field from file. In binary
  2. deletes some binary-plist prefix
  3. delete nulls at the end
  4. creates string from binary with xxd
  5. Gets the name of the contact from string.
  6. creates a folder for that contact
  7. moves file there.

If you have more elegant solution, I would be glad to see them :)
P.S. if you didn't know about where from filed you can find it in get info for some finder items.

To categorize existing downloads you can also add service.

share|improve this answer
    
just so I understand... this will trigger after the file downloads automatically in the default "Downloads/Skype" folder, then your folder action triggers, running your script which then moves the file into the /username(d) folder, which your script creates if it doesn't exist - correct? –  Flak DiNenno Dec 16 '13 at 14:21
    
Yes, correct. But later I found that it can work incorrect with some nicknames. Be careful. –  DanSkeel Dec 17 '13 at 13:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.