Automatic Filing of PDFs by Keywords

I have been attempting to come up with a set of rules to file PDFs by their associated keywords. I have the ScanSnap that allows me to assign keywords by highlighting certain terms. I then want to have those files matched up with client subfolders in my Clients folder. I have hit a bit of a snag with an embedded Applescript. I am simply trying to determine how to get the keywords out in an applescript, and the closest I can come is to get the files properties. I stubbed out a bit of code to throw up a dialog with the properties in it just so I could see what I was working with. The code is as follows:
However, I get an error. The console messages are as follows:
Ultimately, I would like to know what is causing the error so I don't make the same mistake in the future, as well as what code I would actually need for this rule. For the rule, I see the most straightforward way is to make the name of the file reflect the keywords, and then see if the name of the file matches up with another folder in another rule. I would be really happy if I could sort into the appropriate subfolder directly with the keywords, but I don't think I could do that directly.
Thank you for any help.
Bryan
- Code: Select all
try
tell application "Finder"
set displayProperties to (get properties of theFile)
end tell
display dialog displayProperties
on error
display dialog "Didn't Work"
end try
However, I get an error. The console messages are as follows:
- Code: Select all
2012-12-29 20:51:18.644 hazelworker[50217] Processing folder Clients (forced)
2012-12-29 20:51:20.721 hazelworker[50217] 2012_12_26_14_24_19.pdf: Rule Change Name to Keywords matched.
2012-12-29 20:51:21.726 hazelworker[50217] [Error] AppleScript failed: Error executing AppleScript on file /Volumes/Snow Leprd/Data/Clients/2012_12_26_14_24_19.pdf.
2012-12-29 20:51:21.728 hazelworker[50217] AppleScript error: {
NSLocalizedDescription = "No user interaction allowed.";
NSLocalizedFailureReason = "No user interaction allowed.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,2 \"hazelworker\"]>";
OSAScriptErrorAppNameKey = hazelworker;
OSAScriptErrorBriefMessageKey = "No user interaction allowed.";
OSAScriptErrorMessageKey = "No user interaction allowed.";
OSAScriptErrorNumberKey = "-1713";
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
2012-12-29 20:51:22.047 hazelworker[50217] Done processing folder Clients
Ultimately, I would like to know what is causing the error so I don't make the same mistake in the future, as well as what code I would actually need for this rule. For the rule, I see the most straightforward way is to make the name of the file reflect the keywords, and then see if the name of the file matches up with another folder in another rule. I would be really happy if I could sort into the appropriate subfolder directly with the keywords, but I don't think I could do that directly.
Thank you for any help.
Bryan