How to focus the tabs in Safari with AppleScript and avoid opening new
Tell application "system events".
activate an application "Safari".
key code 19 using the command to cmd - down 2 opened a second tab or activate it so open
Open the location "http://example.com".
tell the end
It works fine as long as one of them are real
1. the 2nd tab does not exist yet in this case it will be the 2nd tab and open the url in this place. Or...
2 If the 2nd tab already exists, it will launch the 2nd tab and reload the page until the 2nd tab is already at the location of Web site, we want to be.
But if you say 2 or more tabs open and you run this, if the 2nd tab the DSI not already on the url, you want it to be it will activate the 2nd tab and then open the location of the site in a new tab.
What I want is something like
Code 19 - key using the command down
Set the location of the active tab for the 1 in safari request to "http://example.com".
But this obviously doesn't work. So, how can I know Safari to use only the tabs that I said rather than open new ones every time?
Hello
To set the focus to a tab: use the "class" property of the window tab.
To open a URL: use the URL property of the tab instead of the command "open location".
As this script:
-------
set theUrl to "http://example.com".
Tell application "Safari".
otherwise (there is an active tab from the front window) and then make new document - if no window
the window before saying
If (count the tabs) = 1 then - open URL in new tab
set the active tab (to make the new tag at the end of the tabs with properties {URL: theUrl})
-2 or more tabs
the current value of the tab 2 - the second tab of the focus
the value URL of the tab current theUrl - change the URL of the second tab
end if
tell the end
tell the end
-------
Tags: iOS Developer
Similar Questions
-
How to stop the tab 'Getting started with Mozilla Firefox' to open every time I open FF?
Everytime I open FF, the tab "Getting started with Mozilla Firefox" opens. I checked and it is not in my list of homepage.
If I open any additional windows, it does not open.
But, once I close all the and reopen it again, the tab opens.
I had a similar problem with some addons (ietab) do the same thing.
I found the fix for it.
About: config, filter for 'Start '
Ones you want to should appear at the bottom.
Startup.homepage_override_url and startup.homepage_welcome_url
Double-click on each one and delete the text string. Close and reopen the window to check that it worked.
As I deleted them both at the same time, I'm not sure who was the culprit. So, I suggest starting by striking first and tests before deleting this one.
-
Tell application "system events".
activate an application "Safari".
key code 19 using the command to cmd - down 2 opened a second tab or activate it so open
Open the location "http://example.com".
tell the end
It works fine as long as one of them are real
1. the 2nd tab does not exist yet in this case it will be the 2nd tab and open the url in this place. Or...
2 If the 2nd tab already exists, it will launch the 2nd tab and reload the page until the 2nd tab is already at the location of Web site, we want to be.
But if you say 2 or more tabs open and you run this, if the 2nd tab the DSI not already on the url, you want it to be it will activate the 2nd tab and then open the location of the site in a new tab.
What I want is something like
Code 19 - key using the command down
Set the location of the active tab for the 1 in safari request to "http://example.com".
But this obviously doesn't work. So, how can I know Safari to use only the tabs that I said rather than open new ones every time?
You can try something like that.
tell application "Safari" if not (exists document 1) then make new document tell window 1 if not (exists tab 2) then make new tab set current tab to tab 2 set tab 2's URL to "http://www.google.com" end tell end tell
Briefly tested with Safari on OS X 10.6.8 5.1.10.
Kind regards
H
-
How to get the nfc for work with a7 and samsung galaxy s4
I can't NFC to work on the new A7 with my Samsung Galaxy s4 - someone has these 2 devices and NFC works fine? Or did you have to complete a fix to make it work?
I discovered that the latest android update 4.3 with the samsung galaxy s4 has created problems with nfc communications - a lot of programs that use the nfc no longer works with this new update. I was told by samsung today that there is a known issue and they are working on it.
-
The tab "Getting started with Mozilla Firefox" (as well as my default homepage on another tab) charge whenever I start Firefox. How can I stop this tab open at the start of the program?
If the above did not help, then also see the following articles for more suggestions:
-
How to access the tab 'Save all' when I close several jpeg files that have been adjusted with the "color adjust tool? He is currently making me close and save one at a time. I've just upgraded to El Capitan. Thanks for any help :)
I assume that you use the application overview.
I can't find an answer to back up everything, but a workaround could be while the file menu options are visible, press the option key
and the point of the window will become close, if you click on that dialogue will ask you if you want to restore the changes or save
pressing Save will close the image with the changes and then move to the next image and so on.
-
Im still on 10.5.8 on my G5, I use the mac to pay the Bills... can I update to the latest browser safari with this OS?
N ° try to use TenFourFox.
(143086)
-
How to remove the tab bar?
I don't like tabs and want to use it. The tab bar is a nuisance, and I want to remove it.
Hello, you can use the following extensions to work around him: https://addons.mozilla.org/firefox/addon/hide-tab-bar-with-one-tab/
-
When I close safari, I have an icon in a small box showing the logo of safari with webloc under him. have never seen before. What is it?
It is a webloc file. A link to a certain Web page. Safari creates these when you drag the icon in the left side of the address bar of Safari on the desktop. He can trash if you do not want.
-
How to change the tab order of an array of clusters?
How to change the tab order of an array of clusters? I have the cluster arranged into a table in the front panel. The element of the cluster passes horizontal and array element passes vertically. When I press the tab key, the cursor will move to the item next to the table instead of the next item in the cluster (down to the place overall).
so you have an array of clusters or cluster and the separate table?
-
How to activate the old Windows XP with new serial numbers?
\How to activate the old Windows XP with new serial numbers?
You use a retail disk you had? If so, then the keys do not work due to the fact that they keys of volume.
-
Can someone give an example of how to configure the subnet mask associated with the network and host of an IP address part?
Hi stuckfree,
The question you posted would be more appropriate on the TechNet Forums. I would recommend posting your request here.
http://social.technet.Microsoft.com/forums/en/itproxpsp/threads
-
How to connect the printer wireless hp with the computer?
* - Original title - the printer printing
How to connect the printer wireless hp with the computer?
HP all what you need to be able to complete the task... See here...
http://h71036.WWW7.HP.com/HHO/us/en/EP/articles/Wireless-Setup-Wizard.html
-
1. I upgraded my comp to Windows 7, Ultimate because I need to use many XP programs. What I've discovered, is the virtual XP Mode is not the same thing as XP regular and many programs do not run properly. Particularly theAudio out to lunch and MS GS Wavetable is not available in XP Mode.
2 - I end up having to buy another XP-Professional and installed in the same notebook. I have to turn off the laptop restart and select the Windows 7 to XP operating system. All old programs work fine under XP.
3 - I continued looking for a fix for the XP Audio Mode or virtual. Almost 2 years now, I can not find such a simple solution.
4. today, I found something on the Microsoft RDP Audio driver. What is the reason? Anyone know?
5. are there available MS drivers or resources?
I'm not interested in the commercial programs or attempts to scan my computer. MS sold Windows 7 that can run XP so I think that Microsoft is responsible for fixing.
Thanks in advance,
VT
Windows XP mode - 7: how to get the Realtek Audio Drivers with GS Wavetable outside normal? Instead of RDP Audio driver!
Hello
The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the Windows Virtual PC and XP Mode Forums.
http://social.technet.Microsoft.com/forums/en-us/w7itprovirt/threads
-
Does anyone know how to use the movement of scroller with the function of the fluid width?
Hi all
Does anyone know how to use the movement of scroller with the function of the fluid width?
Thanks, Federico
This feature is not yet implemented.
Maybe you are looking for
-
iCloud unlocked by pc itunes how to open iphone 5s
a locked icloud iphone connect pc. iphone and itunes update. forgotten password help to made a new call id.which id open icloud drive.and see page, settings, tone, number. now what can I do to unlocked icloud and unlock iphone 5 s.
-
Contacts shows only not as much my Mac
Hey I have a question I recently implemented a contact for me with all of my information on her relatives etc, which gives me a total of 44 contacts until I added myself as a contact I had 43. 44 watch on my iOS devices, but 45 shows on my mac did an
-
Problem with the screen on IPAD curtain
Hello I'm a bad psychic, and I have a problem with the screen curtain. A longitudinal of Voice Over, the screen curtain is automatically activate. Normally to turn it off, you must type three times with three fingers. Only on my IPAD when I type thre
-
I have Microsift Essentials, but do I need a registry cleaner also
I don't know if Microsoft Essentials is also a record. I don't know a lot about the registry, but asked me to buy one after that I ran the free scan. The analysis said that I had more than 100 errors. I don't know if they are just trying to sell me s
-
Creation of DVD of Vista freezes when burning
Vista DVD Maker freezes when burning: it was working fine before, but what I get today is "burning (E): Creating DVD, please wait... encoding..." 0.0% ' he sits there and does not activate the process of engraving as it before use. I got a google too