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
IO::All::LWP(3pm)					User Contributed Perl Documentation					 IO::All::LWP(3pm)

NAME
IO::All::LWP - IO::All interface to LWP SYNOPSIS
use IO::All; "hello world " > io('ftp://localhost/test/x'); # save to FTP $content < io('http://example.org'); # GET webpage io('http://example.org') > io('index.html'); # save webpage DESCRIPTION
This module acts as glue between IO::All and LWP, so that files can be read and written through the network using the convenient <IO:All> interface. Note that this module is not "use"d directly: you just use IO::All, which knows when to autoload IO::All::HTTP, IO::All::HTTPS, IO::All::FTP, or IO::All::Gopher, which implement the specific protocols based on IO::All::LWP. EXECUTION MODEL
GET requests. When the IO::All object is opened, the URI is fetched and stored by the object in an internal file handle. It can then be accessed like any other file via the IO::All methods and operators, it can be tied, etc. PUT requests. When the IO::All object is opened, an internal file handle is created. It is possible to that file handle using the various IO::All methods and operators, it can be tied, etc. If $io->put is not called explicitly, when the IO::All object is closed, either explicitly via $io->close or automatically upon destruction, the actual PUT request is made. The bad news is that the whole file is stored in memory after getting it or before putting it. This may cause problems if you are dealing with multi-gigabyte files! METHODS
The simplest way of doing things is via the overloaded operators > and <, as shown in the SYNOPSIS. These take care of automatically opening and closing the files and connections as needed. However, various methods are available to provide a finer degree of control. This is a subclass of IO::All. In addition to the inherited methods, the following methods are available: o ua Set or get the user agent object (LWP::UserAgent or a subclass). If called with a list, the list is passed to LWP::UserAgent->new. If called with an object, the object is used directly as the user agent. Note that there is a default user agent if no user agent is specified. o uri Set or get the URI. It can take either a URI object or a string, and it returns an URI object. Note that calling this method overrides the user and password fields, because URIs can contain authentication information. o user Set or get the user name for authentication. Note that the user name (and the password) can also be set as part of the URL, as in "http://me:secret@example.com/". o password Set or get the password for authentication. Note that the password can also be set as part of the URL, as discussed above. o get GET the current URI using LWP. Or, if called with an HTTP::Request object as a parameter, it does that request instead. It returns the HTTP::Response object. o put PUT to the current URI using LWP. If called with an HTTP::Request object, it does that request instead. If called with a scalar, it PUTs that as the content to the current URI, instead of the current accumulated content. o response Return the HTTP::Response object. o request Does an LWP request. It requires an HTTP::Request object as a parameter. Returns an HTTP::Response object. o open Overrides the "open" method from IO::All. It takes care of GETting the content, or of setting up the internal buffer for PUTting. Just like the "open" method from IO::All, it can take a mode: '<' for GET and '>' for PUT. o close Overrides the "close" method from IO::All. It takes care of PUTting the content. DEPENDENCIES
This module uses LWP for all the heavy lifting. It also requires perl-5.8.0 or a more recent version. SEE ALSO
IO::All, LWP, IO::All::HTTP, IO::All::FTP. AUTHORS
Ivan Tubert-Brohman <itub@cpan.org> and Brian Ingerson <ingy@cpan.org> Thanks to Sergey Gleizer for the ua method. COPYRIGHT
Copyright (c) 2007. Ivan Tubert-Brohman and Brian Ingerson. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.0 2007-03-29 IO::All::LWP(3pm)
All times are GMT -4. The time now is 10:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy