Save this following AppleScript code to… /Users/YOUR SHORT NAME/Library/Workflows/Applications/Folder Actions ..folder as a script file. You can name it something like “Change Default Application.scpt”
I don't have Acrobat reader on my system so I used TextEdit.app as one of my variables instead. You can change that value in line 2 of the code, to suit your needs. Line 3 of the code is what tells the script which application to use as the default app for the PDF files located within the folder that the folder action is attached to.
property Default_App_To_Open_With1 : alias "Macintosh HD:Applications:Preview.app:"
property Default_App_To_Open_With2 : alias "Macintosh HD:Applications:TextEdit.app:"
property Default_App : Default_App_To_Open_With2
property name_Extension : "pdf"
on adding folder items to this_folder after receiving dropped_items
repeat with this_File in dropped_items
tell application "System Events"
if name extension of this_File is name_Extension then
set default application of this_File to Default_App
end if
end tell
end repeat
end adding folder items to
After this code is tweaked to your liking, and has been saved to the previous mentioned folder, it will then be available to use within the Folder Actions Setup.app to to attach to any folder of your choice
