0

Is it possible to get the URL of current tab of a Browser in C? I can do it using AppleScript but I want to use C language. Maybe I calling system, I don't know.help me please

Suraj Jain
  • 4,463
  • 28
  • 39
  • Possible? Certainly. How to? Too broad. – Eugene Sh. Feb 03 '17 at 15:06
  • Maybe a browser has some API ? – Yuriy Ivaskevych Feb 03 '17 at 15:06
  • What Browser? Isn't that at least a reasonable thing to specify? – unwind Feb 03 '17 at 15:12
  • If you can do it with AppleScript, you can send the corresponding [AppleEvents](https://en.wikipedia.org/wiki/Apple_event) from C. I think you can also compile and execute AppleScript from C. Consult the XCode help system. You can also execute AppleScript using the `osascript` command (see `man osascript`). – molbdnilo Feb 03 '17 at 15:43

1 Answers1

0

You can actually use the accessibility framework to get the url for both Safari and Chrome (verified). The API is entirely in C but you do need to link to the ApplicationServices framework.

cutsoy
  • 10,127
  • 4
  • 40
  • 57