From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Franke Subject: Re: Get links from Firefox/Safari into orgmode Date: Sun, 22 Jun 2014 02:12:18 +0200 Message-ID: <28E09BEF-DE24-40DA-B63D-A8DDBADA0C4D@dfranke.com> References: <36ECB38A-86A2-40CB-98A5-D7C3ABEA963D@dfranke.com> <77D73F63-E1D2-4FBA-9873-7989B028FC59@dfranke.com> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A44517A1-BF19-4274-AB40-DECCA6D88884"; protocol="application/pgp-signature"; micalg=pgp-sha512 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WyVOX-0003fS-8Y for emacs-orgmode@gnu.org; Sat, 21 Jun 2014 20:12:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WyVOS-0007JI-87 for emacs-orgmode@gnu.org; Sat, 21 Jun 2014 20:12:29 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:49361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WyVOR-0007J4-VT for emacs-orgmode@gnu.org; Sat, 21 Jun 2014 20:12:24 -0400 Received: by mail-we0-f172.google.com with SMTP id u57so5299801wes.31 for ; Sat, 21 Jun 2014 17:12:22 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Haider Rizvi Cc: emacs-orgmode@gnu.org --Apple-Mail=_A44517A1-BF19-4274-AB40-DECCA6D88884 Content-Type: multipart/alternative; boundary="Apple-Mail=_D37A7636-1181-4FC1-9B84-71E3A6C10874" --Apple-Mail=_D37A7636-1181-4FC1-9B84-71E3A6C10874 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 21 Jun 2014, at 22:34, Haider Rizvi wrote: > Daniel Franke writes: >=20 >> emacs =3D> firefox/safari > That's correct. >=20 >> browser =3D> emacs >=20 > Probably the best is to use an Applescript like below, and save it in > ~/Library/Scripts/Applications/Safari. You can kick off this > Applescript using a variety of methods (Quicksilver, menu bar, etc.) >=20 > http://www.tuaw.com/2006/08/08/tuaw-tip-enable-the-applescript-menu/ >=20 >=20 > tell application "Safari" > set theUrl to URL of document 1 > set theName to the name of the document 1 > set theOrglink to "[[" & theUrl & "][" & theName & "]]" > set the clipboard to theOrglink > end tell >=20 > activate application "Emacs" >=20 > -- this last bit is iffy, since Emacs will not always have an org file > -- open in the frame that pops up.=20 > tell application "System Events" > keystroke "y" using control down > end tell >=20 > Hope this helps. >=20 > Regards,=20 > --=20 > Haider >=20 >=20 Good evening Haider. thank you so much for your input, this helps a lot!! :) Now i have a = working solution. I used the script you suggest with a small change : tell application "Safari" set theUrl to URL of document 1 set theName to the name of the document 1 set theOrglink to "[[" & theUrl & "][" & theName & "]]" set the clipboard to theOrglink end tell activate application "Emacs" tell application "System Events" keystroke "v" using {command down} keystroke return end tell activate application "Safari" and then I opened it with the application Fastscripts = (http://www.red-sweater.com/fastscripts/). No i have the option to add = the bookmark by keystroke to the=20 actual open Emacs window. Regards, Daniel! --Apple-Mail=_D37A7636-1181-4FC1-9B84-71E3A6C10874 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii On 21 = Jun 2014, at 22:34, Haider Rizvi <harizvi@gmail.com> = wrote:

Daniel Franke <daniel@dfranke.com> = writes:

emacs =3D> = firefox/safari
That's correct.

browser =3D> emacs

Probably the = best is to use an Applescript like below, and save it = in
~/Library/Scripts/Applications/Safari. You can kick off = this
Applescript using a variety of methods (Quicksilver, menu bar, = etc.)

http://www.tuaw.com/2006/08/08/tuaw-tip-enable-the-applescript-menu/


tell application "Safari"
set theUrl to URL of document = 1
= set theName to the name of the document 1
set = theOrglink to "[[" & theUrl & "][" & theName & = "]]"
= set the clipboard to theOrglink
end tell

activate = application "Emacs"

-- this last bit is iffy, since Emacs will = not always have an org file
--  open in the frame that pops up. =
tell application "System Events"
keystroke "y" using control = down
end tell

Hope this helps.

Regards,
-- =
Haider



Good evening = Haider.

thank you so much for your input, this helps = a lot!! :) Now i have a working solution.

I = used the script you suggest with a small change :

tell application "Safari"
= set theUrl to URL of document 1
= set theName to the name of the document 1
= set theOrglink to "[[" & theUrl & "][" = & theName & "]]"
= set the clipboard to theOrglink
end tell


activate application "Emacs"
tell application "System Events"
= keystroke "v" using {command = down}
= keystroke return
end tell
activate application "Safari"

and then = I opened it with the application Fastscripts (http://www.red-sweater.co= m/fastscripts/). No i have the option to add the bookmark by = keystroke  to the 
actual open Emacs = window.

Regards,
Daniel!

= --Apple-Mail=_D37A7636-1181-4FC1-9B84-71E3A6C10874-- --Apple-Mail=_A44517A1-BF19-4274-AB40-DECCA6D88884 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GnuPT 2.8.2 iQQcBAEBCgAGBQJTph9iAAoJENZYvtsbo/qfFTcgALioJmTbBC7el7CYsdazpAfi BcDQRCoT/lwyrifPigKFmAaxvSftXJsMSHMBLTyo+VvPSvXpzMbJ9T7Ufvumy/ah 54G2hLWsTFGys/bhtYyzDuzqDPOW8btntYXSzt7rHd34c9yqQLv0xPwVcyuPayLs k3+2BKD3K3Zw+1EmZ7i6Ek6a1kCFzMUmo8OG0MH1BPqncvbCgDi7f/0P5rW0NwuL J1mXiF+EbZFGRV5lO0UwxeskIoYW5QZPVvmE0FeyEB7ErXisiCq4ke5QmsEuvZdU DS3UtZ97tkh9pEvKFpj+0iE9hY4BscZFbX2niS0aKUuFD49DVIUN00aRgZLKyxag snLvbe+6RpgRheVV0R4e9W5DZl7CQS/n5HKM8usgRWBEci1wJse2x8nXUifMHH+d TZRGgdx4Uyet+gfa/PQ81aCBtWtGnbht/2hW35eSjgJddeGxqvSMbUoDO0Q6jGHP 3hBoCJuQuPXqRUZa//5YI5/TmAp6yNSO43+GoLjW9sxIsgXa8MMScU1GByI32sfJ /gFVhYwlD2X1dp4oDu6/swPUKsLeHyAEZJ+5r49/AVL7kBzGRs6JhMqabIFN2MXy X1DzBKLiNCc18gTfQVJqnGJNddPSQLOjQ6KJS3FdUS2UeDeuVR3F/bC/RmsTgPSe zlSoMKqe83os5IIPxRFDwK2E2tlSvkd+ybyt5yga1B04gizs9WRIU31WBNiD5KWi Y5Pm1fzLaUjc7Sg117Y/wMtzciZYtYf48e8eg963GygHr9j4VuG6COuElVZCKg34 dg/l8guOVM87N100YQt7M3dupiouF2fDlcUcQMvXiBuf+LPWhhw3DUCbbWwMDbHk RUuJagE6lbD0ZNd1zW1MqA/hspcTBEML2zy8+wdS/AjKVoGkH+iaHaCIXoXOEEid n7f+zoMvAM+yxN6VDtFoQrhOQJeLs9OwJYce1uXltvlUF4mkTSKNAGsO/LrxSIgb xCBNqM+/WMNwHR3O1/pwPkU14t4QMDnISoRDgjloCjyQW4wr85OQyisTZBAR8D8M PXeLXcsEHaUbqfwtJZlB0ICMGZfXyzvndPShn9UzyFY3V3KqWB+WObrHN6wqv4x3 qzIwL0qfi/p2RhLj0oSc1ejm0GA+Pp/1iUs2EKm4rmzpppVaHIiDxQBVOoqXHrqw DYhhaMQT69r4cwhsPitNkA085ARWdTKF/e8PN81CK4LIs86c9VD5Zyeuce+bhcgA 7CDJp0kxzikiVeLJMLEEwTURcos8gfz+9BI4qye+S51iMHneP0am1ET9+kxg673R kylWsrjxoMem1i5U8lJ9Uztz1wpip+3+Fy/uW+AFqyuNi2A2J9+ptpZjWWF+bwA= =is8Q -----END PGP SIGNATURE----- --Apple-Mail=_A44517A1-BF19-4274-AB40-DECCA6D88884--