Sponsored Content
Top Forums Shell Programming and Scripting Applescript to open webpage from list, search for "text" Post 302939514 by protocomm on Thursday 26th of March 2015 05:55:22 AM
Old 03-26-2015
For the second part of your code, test this...

Code:
tell application "Safari"
	activate

        --the source code of current Tab
	set sourceOfTab to source of front document

	set urlOfTab to URL of front document

	if sourceOfTab contains "your text" then

                --copy of the url in textFile
		do shell script "echo " & urlOfTab & " >> ~/text.txt"
	else
		close current tab of front window
	end if
end tell


Last edited by protocomm; 03-26-2015 at 07:06 AM..
 

9 More Discussions You Might Find Interesting

1. SuSE

VMDB Failure" followed by "Unable to open snapshot file"

keep getting an error when I try to revert to a snapshot: "VMDB Failure" followed by "Unable to open snapshot file" Im using vmware server 1.0.4, host OS is windows xp and guest OS is SLES. Is there anything I can do to recover the snapshot or am I in trouble!?!?! (0 Replies)
Discussion started by: s_linux
0 Replies

2. IP Networking

Unknown open port: "6881/tcp open bittorrent-tracker" found with nmap

Hi. I ran nmap on my server, and I get the following: Starting Nmap 4.76 ( http://nmap.org ) at 2009-03-19 16:33 EDT Interesting ports on -------- (-----): Not shown: 997 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 6881/tcp open bittorrent-tracker The... (0 Replies)
Discussion started by: Rledley
0 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

5. Shell Programming and Scripting

Read from "list1" and list matches in "list2"

I want to print any matching IP addresse in List1 with List 2; List 1 List of IP addresses; 161.85.58.210 250.57.15.129 217.23.162.249 74.76.129.101 30.221.177.237 3.147.200.59 170.58.142.64 127.65.109.33 150.167.242.146 223.3.20.186 25.181.180.99 2.55.199.32 (3 Replies)
Discussion started by: lewk
3 Replies

6. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

7. OS X (Apple)

Applescript to open webpages from list, search for "text"

posted this first in the shell area, realized it was wrong area for this, forgive me hi guys, its me, doritos guy, I've laid off of the doritos for a while, twas given me stomach problems. you know when you eat 10 family size bags a day it might cause a problem, any-who i appreciated the help... (0 Replies)
Discussion started by: ilovedoritos
0 Replies

8. Open Source

Applescript if url of tab contains "text" click link

this works for what i need it to, but need to add function that will click on link if urloftab contains "300" the last url of each page ends in "300", so i figure that if I add a function that for every tab it open it will also search to see if url contains "300". if it contains "300" click link... (0 Replies)
Discussion started by: ilovedoritos
0 Replies

9. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies
ELINKSKEYS(5)							ELinks keybindings						     ELINKSKEYS(5)

NAME
elinkskeys - keybindings for ELinks SYNOPSIS
Information on how to configure keybinding and overview of the default keybindings. DESCRIPTION
Key binding for elinks should be placed in the file ~/.elinks/elinks.conf. Note that any information regarding their format/structure may not be up-to-date. If you will discover that, please feed us with a patch. Key binding statements are of the form: bind <keymap> <keystroke> = <action> where: <keymap> is main, edit, or menu. The main keymap is used for general browsing. The edit keymap is used for editing text fields. The menu keymap is used for navigating menus. <keystroke> is a case sensitive key, which you can prefix with Ctrl-, Alt-, or both. Ctrl- must be followed by an uppercase key. See below for a list of valid keys. <action> is what the key should do. The actions available are dependent on the keymap, and are listed separately below. All words/strings may all be quoted "like so". Backslashes are escape characters, even if not between quotes. Lines beginning with a hash character (#) are comments. Keys can be unbound just by binding them to the special none action. It may be of use if you accidentally type a key often. EXAMPLE BINDINGS
Some sample keybindings: bind "main" "v" = "view-image" bind "main" "l" = "jump-to-link" bind "main" "L" = "link-menu" bind "main" "F10" = "file-menu" bind "main" "F9" = "menu" bind "main" "Escape" = "menu" bind "edit" "Ctrl-R" = "auto-complete-unambiguous" bind "edit" "Ctrl-W" = "auto-complete" bind "edit" "Ctrl-K" = "kill-to-eol" bind "menu" "Ctrl-B" = "page-up" bind "menu" "PageUp" = "page-up" bind "menu" "Ctrl-F" = "page-down" bind "menu" "PageDown" = "page-down" # ELinks with Lua support bind "main" "," = "lua-console" KEYS
Valid keys are: alphanumeric characters, punctuation, Enter, Backspace, Tab, Escape, Left, Right, Up, Down, Insert, Delete, Home, End, PageUp, PageDown, F1 to F12. Some keys will need to be quoted or escaped. For example, space can be written as " " (quote space quote), and the quote itself as " (backslash quote). Backslash can be written as \ (double backslash). KEYMAP ACTIONS
MAIN ACTIONS abort-connection Abort connection. add-bookmark Add a new bookmark. add-bookmark-link Add a new bookmark using current link. add-bookmark-tabs Bookmark all open tabs. auth-manager Open authentication manager. backspace-prefix Backspace the last entered digit of the current prefix. bookmark-manager Open bookmark manager. cache-manager Open cache manager. cache-minimize Free unused cache entries. cookie-manager Open cookie manager. cookies-load Reload cookies file. copy-clipboard Copy text to clipboard. document-info Show information about the current page. download-manager Open download manager. exmode Enter ex-mode (command line). file-menu Open the File menu. find-next Find the next occurrence of the current search text. find-next-back Find the previous occurrence of the current search text. forget-credentials Forget authentication credentials. formhist-manager Open form history manager. frame-external-command Pass URI of current frame to external command. frame-maximize Maximize the current frame. frame-next Move to the next frame. frame-prev Move to the previous frame. goto-url Open "Go to URL" dialog box. goto-url-current Open "Go to URL" dialog box containing the current URL. goto-url-current-link Open "Go to URL" dialog box containing the current link URL. goto-url-home Go to the homepage. header-info Show information about the current page protocol headers. history-manager Open history manager. history-move-back Return to the previous document in history. history-move-forward Go forward in history. jump-to-link Jump to link. keybinding-manager Open keybinding manager. kill-backgrounded-connections Kill all backgrounded connections. link-download Download the current link. link-download-image Download the current image. link-download-resume Attempt to resume download of the current link. link-external-command Pass URI of current link to external command. link-follow Follow the current link. link-follow-reload Follow the current link, forcing reload of the target. link-menu Open the link context menu. link-form-menu Open the form fields menu. lua-console Open a Lua console. mark-goto Go at a specified mark. mark-set Set a mark. menu Activate the menu. move-cursor-down Move cursor down. move-cursor-left Move cursor left. move-cursor-line-start Move cursor to the start of the line. move-cursor-right Move cursor right. move-cursor-up Move cursor up. move-document-end Move to the end of the document. move-document-start Move to the start of the document. move-link-down Move one link down. move-link-down-line Move to the next line with a link. move-link-left Move one link left. move-link-left-line Move one link left or to the previous link. move-link-next Move to the next link. move-link-prev Move to the previous link. move-link-right Move one link right. move-link-right-line Move one link right or to the next link. move-link-up Move one link up. move-link-up-line Move to the previous line with a link. move-page-down Move downwards by a page. move-page-up Move upwards by a page. open-link-in-new-tab Open the current link in a new tab. open-link-in-new-tab-in-background Open the current link in a new tab in the background. open-link-in-new-window Open the current link in a new window. open-new-tab Open a new tab. open-new-tab-in-background Open a new tab in the background. open-new-window Open a new window. open-os-shell Open an OS shell. options-manager Open options manager. quit Open a quit confirmation dialog box. really-quit Quit without confirmation. redraw Redraw the terminal. reload Reload the current page. rerender Re-render the current page. reset-form Reset form items to their initial values. resource-info Show information about the currently used resources. save-as Save the current document in source form. save-formatted Save the current document in formatted form. save-options Save options. save-url-as Save URL as. scroll-down Scroll down. scroll-left Scroll left. scroll-right Scroll right. scroll-up Scroll up. search Search for a text pattern. search-back Search backwards for a text pattern. search-typeahead Search link text by typing ahead. search-typeahead-link Search link text by typing ahead. search-typeahead-text Search document text by typing ahead. search-typeahead-text-back Search document text backwards by typing ahead. show-term-options Show terminal options dialog. submit-form Submit form. submit-form-reload Submit form and reload. tab-close Close tab. tab-close-all-but-current Close all tabs but the current one. tab-external-command Pass URI of current tab to external command. tab-menu Open the tab menu. tab-move-left Move the current tab to the left. tab-move-right Move the current tab to the right. tab-next Next tab. tab-prev Previous tab. terminal-resize Open the terminal resize dialog. toggle-css Toggle rendering of page using CSS. toggle-display-images Toggle displaying of links to images. toggle-display-tables Toggle rendering of tables. toggle-document-colors Toggle usage of document specific colors. toggle-html-plain Toggle rendering page as HTML / plain text. toggle-mouse Toggle mouse handling. toggle-numbered-links Toggle displaying of links numbers. toggle-plain-compress-empty-lines Toggle plain renderer compression of empty lines. toggle-wrap-text Toggle wrapping of text. view-image View the current image. EDIT ACTIONS auto-complete Attempt to auto-complete the input. auto-complete-file Attempt to auto-complete a local file. auto-complete-unambiguous Attempt to unambiguously auto-complete the input. backspace Delete character in front of the cursor. beginning-of-buffer Go to the first line of the buffer. cancel Cancel current state. copy-clipboard Copy text to clipboard. cut-clipboard Cut text to clipboard. delete Delete character under cursor. down Move cursor downwards. end Go to the end of the page/line. end-of-buffer Go to the last line of the buffer. enter Follow the current link. home Go to the start of the page/line. kill-to-bol Delete to beginning of line. kill-to-eol Delete to end of line. kill-word-back Delete backwards to start of word. left Move the cursor left. move-backward-word Move cursor before current word. move-forward-word Move cursor after current word. next-item Move to the next item. open-external Open in external editor. paste-clipboard Paste text from the clipboard. previous-item Move to the previous item. redraw Redraw the terminal. right Move the cursor right. search-toggle-regex Toggle regex matching (type-ahead searching). up Move cursor upwards. MENU ACTIONS cancel Cancel current state. delete Delete character under cursor. down Move cursor downwards. end Go to the end of the page/line. enter Follow the current link. expand Expand item. home Go to the start of the page/line. left Move the cursor left. mark-item Mark item. next-item Move to the next item. page-down Move downwards by a page. page-up Move upwards by a page. previous-item Move to the previous item. redraw Redraw the terminal. right Move the cursor right. search Search for a text pattern. select Select current highlighted item. unexpand Collapse item. up Move cursor upwards. DEFAULT BINDINGS
The default bindings are shown below. Any bindings in ~/.elinks/elinks.conf will override these. MAIN KEYS Space Move downwards by a page (move-page-down) "#" Search link text by typing ahead (search-typeahead) "%" Toggle usage of document specific colors (toggle-document-colors) "*" Toggle displaying of links to images (toggle-display-images) "," Open a Lua console (lua-console) "." Toggle displaying of links numbers (toggle-numbered-links) "/" Search for a text pattern (search) ":" Enter ex-mode (command line) (exmode) "<" Previous tab (tab-prev) Alt-"<" Move the current tab to the left (tab-move-left) "=" Show information about the current page (document-info) ">" Next tab (tab-next) Alt-">" Move the current tab to the right (tab-move-right) "?" Search backwards for a text pattern (search-back) "A" Add a new bookmark using current link (add-bookmark-link) Ctrl-"A" Move to the start of the document (move-document-start) Ctrl-"B" Move upwards by a page (move-page-up) "C" Open cache manager (cache-manager) "D" Open download manager (download-manager) "E" Open "Go to URL" dialog box containing the current link URL (goto-url-current-link) Ctrl-"E" Move to the end of the document (move-document-end) "F" Open form history manager (formhist-manager) Ctrl-"F" Move downwards by a page (move-page-down) "G" Open "Go to URL" dialog box containing the current URL (goto-url-current) "H" Go to the homepage (goto-url-home) "K" Open cookie manager (cookie-manager) Ctrl-"K" Reload cookies file (cookies-load) "L" Open the link context menu (link-menu) Ctrl-"L" Redraw the terminal (redraw) "N" Find the previous occurrence of the current search text (find-next-back) Ctrl-"N" Scroll down (scroll-down) Ctrl-"P" Scroll up (scroll-up) "Q" Quit without confirmation (really-quit) Ctrl-"R" Reload the current page (reload) "T" Open the current link in a new tab in the background (open-link-in-new-tab-in-background) "W" Toggle wrapping of text (toggle-wrap-text) "[" Scroll left (scroll-left) "'" Go at a specified mark (mark-goto) "" Toggle rendering page as HTML / plain text (toggle-html-plain) "]" Scroll right (scroll-right) "a" Add a new bookmark (add-bookmark) "b" Move upwards by a page (move-page-up) "c" Close tab (tab-close) "d" Download the current link (link-download) "e" Open the tab menu (tab-menu) "f" Maximize the current frame (frame-maximize) "g" Open "Go to URL" dialog box (goto-url) "h" Open history manager (history-manager) "k" Open keybinding manager (keybinding-manager) "l" Jump to link (jump-to-link) "m" Set a mark (mark-set) "n" Find the next occurrence of the current search text (find-next) "o" Open options manager (options-manager) "q" Open a quit confirmation dialog box (quit) "r" Attempt to resume download of the current link (link-download-resume) "s" Open bookmark manager (bookmark-manager) "t" Open a new tab (open-new-tab) "u" Go forward in history (history-move-forward) "v" View the current image (view-image) "x" Follow the current link, forcing reload of the target (link-follow-reload) "z" Abort connection (abort-connection) "{" Scroll left (scroll-left) "|" Show information about the current page protocol headers (header-info) "}" Scroll right (scroll-right) Backspace Backspace the last entered digit of the current prefix (backspace-prefix) Delete Scroll down (scroll-down) Down Move to the next link (move-link-next) End Move to the end of the document (move-document-end) Enter Follow the current link (link-follow) Ctrl-Enter Follow the current link, forcing reload of the target (link-follow-reload) Escape Activate the menu (menu) F10 Open the File menu (file-menu) F9 Activate the menu (menu) Home Move to the start of the document (move-document-start) Insert Scroll up (scroll-up) Ctrl-Insert Copy text to clipboard (copy-clipboard) Left Return to the previous document in history (history-move-back) PageDown Move downwards by a page (move-page-down) PageUp Move upwards by a page (move-page-up) Right Follow the current link (link-follow) Ctrl-Right Follow the current link, forcing reload of the target (link-follow-reload) Tab Move to the next frame (frame-next) Alt-Tab Move to the previous frame (frame-prev) Shift-Tab Move to the previous frame (frame-prev) Up Move to the previous link (move-link-prev) EDIT KEYS Alt-"<" Go to the first line of the buffer (beginning-of-buffer) Alt-">" Go to the last line of the buffer (end-of-buffer) Ctrl-"A" Go to the start of the page/line (home) Alt-"b" Move cursor before current word (move-backward-word) Ctrl-"D" Delete character under cursor (delete) Ctrl-"E" Go to the end of the page/line (end) Alt-"f" Move cursor after current word (move-forward-word) Ctrl-"H" Delete character in front of the cursor (backspace) Ctrl-"K" Delete to end of line (kill-to-eol) Ctrl-"L" Redraw the terminal (redraw) Alt-"r" Toggle regex matching (type-ahead searching) (search-toggle-regex) Ctrl-"F" Attempt to auto-complete a local file (auto-complete-file) Ctrl-"R" Attempt to unambiguously auto-complete the input (auto-complete-unambiguous) Ctrl-"T" Open in external editor (open-external) Ctrl-"U" Delete to beginning of line (kill-to-bol) Ctrl-"V" Paste text from the clipboard (paste-clipboard) Ctrl-"W" Attempt to auto-complete the input (auto-complete) Ctrl-"X" Cut text to clipboard (cut-clipboard) Alt-Backspace Delete backwards to start of word (kill-word-back) Backspace Delete character in front of the cursor (backspace) Delete Delete character under cursor (delete) Down Move cursor downwards (down) End Go to the end of the page/line (end) Enter Follow the current link (enter) Escape Cancel current state (cancel) F4 Open in external editor (open-external) Home Go to the start of the page/line (home) Ctrl-Insert Copy text to clipboard (copy-clipboard) Left Move the cursor left (left) Right Move the cursor right (right) Tab Move to the next item (next-item) Alt-Tab Move to the previous item (previous-item) Shift-Tab Move to the previous item (previous-item) Up Move cursor upwards (up) MENU KEYS Space Select current highlighted item (select) "*" Mark item (mark-item) "+" Expand item (expand) "-" Collapse item (unexpand) "/" Search for a text pattern (search) "=" Expand item (expand) Ctrl-"A" Go to the start of the page/line (home) Ctrl-"B" Move upwards by a page (page-up) Ctrl-"E" Go to the end of the page/line (end) Ctrl-"F" Move downwards by a page (page-down) Ctrl-"L" Redraw the terminal (redraw) Ctrl-"N" Move cursor downwards (down) Ctrl-"P" Move cursor upwards (up) Alt-"V" Move upwards by a page (page-up) Ctrl-"V" Move downwards by a page (page-down) "[" Expand item (expand) "]" Collapse item (unexpand) "_" Collapse item (unexpand) Delete Delete character under cursor (delete) Down Move cursor downwards (down) End Go to the end of the page/line (end) Enter Follow the current link (enter) Escape Cancel current state (cancel) Home Go to the start of the page/line (home) Insert Mark item (mark-item) Left Move the cursor left (left) PageDown Move downwards by a page (page-down) PageUp Move upwards by a page (page-up) Right Move the cursor right (right) Tab Move to the next item (next-item) Alt-Tab Move to the previous item (previous-item) Shift-Tab Move to the previous item (previous-item) Up Move cursor upwards (up) AUTHOR
This manual page was finally written by Peter Wang (one and a half years after writing the binding code), using excerpts by David Mediavilla. You can thank Petr Baudis for the subtle requests for documentation. Updated by Zas. Moved to asciidoc format and cleaned up by Jonas Fonseca. SEE ALSO
elinks(1), elinks.conf(5) ELinks 0.12pre5 07/07/2009 ELINKSKEYS(5)
All times are GMT -4. The time now is 10:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy