How to get going with a Hazel script copied from website?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi,

Please bear with me. Totally new to Hazel and actually looking to achieve immporting / indexing in Devonthink Pro Office.
Running on 10.6.8
Hazel v 3.0.18 (trial)
I'm trying to get this http://forum.devontechnologies.com/viewtopic.php?f=20&t=17344 code running.

I have edited like this:
Code: Select all
tell application "Finder"
   set _path to /Volumes/pt1/Users/erwin/DT/2014.dtBase2/
   set {_name, _extension} to {name, name extension} of theFile
   
   -- optional: hide extension in Finder
   -- set extension hidden of theFile to true
   
   -- optional: remove extension for DEVONthink displays
   -- set _name to text 1 thru -((count _extension) + 2) of _name
   -- set _extension to "." & _extension
end tell

-- Launch DEVONthink if it isn't already open.
tell application "System Events"
   if not (exists process "DEVONthink Pro Office") then
      tell application id "com.devon-technologies.thinkpro2" to activate
   end if
end tell

-- Import the file.

tell application id "com.devon-technologies.thinkpro2"
   set theGroup to get record with uuid "44F5A879-DF80-46B8-8045-7E4C644C036B"
   
   -- choose one option, Index or Import, comment out the other
   -- set theImport to import _path name _name to theGroup
   set theIndex to indicate _path to theGroup
end tell


Then tried to import it, open it with Hazel and the same after adding .hazelrules as an extension to no avail.

Can someone enlighten me on how to do this? Or point me to some tutorial showcasing this?

Thanks a lot!
panini
 
Posts: 23
Joined: Mon Dec 08, 2014 6:54 pm

That is an AppleScript. It's not a Hazel rule. Try using the "Run AppleScript" action and use the script there. That said, if you don't understand what you are doing, I would tread with caution as there is potential to mess up your files here.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for replying. Admittedly I downloaded and installed Hazel to kind of 'quickly' achieve my goal.
I managed to get it working.
I'll try to free up time to work through the help file. It does contain much more information than I could quickly find yesterday, so thanks for that.

Can you recommend some tutorial to get going more rapidly?
panini
 
Posts: 23
Joined: Mon Dec 08, 2014 6:54 pm

Check the buzz page: http://www.noodlesoft.com/buzz

That contains articles, videos and such that should help.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support