Is it possible to create a hook so that It clocks in automatically whenever org file is opened for editing Kindly help
You could use a file local variable setting like this in your org file:
# Local Variables: # eval: (org-clock-in) # End:
This has the benefit of only affecting the files you put it in. If you want it in every file, even new ones, you can make a hook function like this.
(defun my-clock-in () (when (org-before-first-heading-p) (org-insert-heading) (insert " " (read-string "Heading: "))) (org-clock-in)) (add-hook 'org-mode-hook 'my-clock-in)
Note this assumes there is a heading at the beginning of the file, and will add one if not. If that isn't what you want you will have to use a better logic, e.g. to search for an appropriate headline to clock into.
This might not do exactly what you want though, e.g. if you have a set of org buffers open and switch between them, it will not switch the clock between them. There are
focus-out-hook that might be suitable for that.