How to activate window, not app?

I'm trying to write a very simple applescript to just create a new
Terminal window and set it to be frontmost (i.e. so it has focus)
without raising all the other Terminal I have open. The following
creates the new Terminal window but results in all the other Terminal
windows I have open behind my other windows being raised, which I'm
trying to avoid:
tell application "Terminal"
activate
do script ""
end tell
I stumbled on an old thread that seemed to be asking the same
question at http://groups.google.com/group/alt.comp.lang.applescript/browse_frm/thread/31a26 61b7ee29f06, but I don't see how the example given accomplishes this. Can anyone help?
Thanks!
Josh
[Note: Cross posted from http://groups.google.com/group/alt.comp.lang.applescript/browse_frm/thread/b1fee 62777be00e2, as I haven't had any responses on the newsgroup.]

_PLEASE NOTE_: A few hours ago I inadvertently posted this as a reply to Pierre L. (which is okay, as I'd like him to have a look at it as well). But, in the meantime, I've made a very small change to the Finisher_.app, and I've included that in this response -- it's probably totally unnecessary, but could conceivably improve the overall reliability of this approach. There is one other issue I'm a bit concerned about (although I haven't had any problems); but, if you should get an error message regarding the PID number ("doesn't exist"), let me know and I'll see what I can do about it.
No promises, and I've sort of lost track of your original goal, but you might try this double-pronged approach:
1) paste this script into your editor and save it as "Starter_" _as an application to the desktop_:
tell application "Terminal"
set visible of every window whose visible is true to false
do script ""
set WinID_ to item 1 of every window
end tell
tell application "Finisher_" to activate
2) Now paste the following script into a fresh editor window and save it as "Finisher_" _as an application to the desktop_:
set PIDlist_ to do shell script "ps -cx"
set PIDcnt_ to count paragraphs of PIDlist_
repeat with i_ from 1 to PIDcnt_
set TarPar_ to paragraph i_ of PIDlist_
if TarPar_ contains "Starter_.app" then
set Starter_PID to characters 1 through 5 of TarPar_ as string
exit repeat
end if
end repeat
tell application "Terminal" to activate
do shell script "kill " & Starter_PID
*From this point on, ignore the Finisher_.app on the desktop* (it probably can be saved elsewhere).
Now arrange the desktop as you wish, with Terminal windows you can afford to lose (but I don't expect you will). Then double-click "Starter_.app" and see what that buys you. Once again, the original Terminal windows should be retrievable by quitting and relaunching Terminal.
This works for me to bring up a new Terminal window (only) at the front of all windows of other applications, with Terminal in focus. And, once again, seems to me a lot of other things could be accomplished with this approach, but we'll see.

Similar Messages

  • How can I get notes (app Notes) from HTC HD2 smartphone with OS Windows mobile 6.5 to my iPhone 4S ?

    How can I get notes (app Notes) from HTC HD2 smartphone with OS Windows mobile 6.5 to my iPhone 4S ?

    iPhonePeter wrote:
    What about file format? (In windows mobile is *.pwi)
    Irrelevant if you cut and paste the content of the note into an email.

  • How to activate Windows 8.1 on a Windows 2008 R2 KMS server when I don't have Windows 2012 R2 kms host key

    I only have windows 8.1 kms host key but I can't add a client OS kms key to Windows 2008 R2 kms server. And I don't have Windows 2012 R2 license either. Is there any way I can activate Windows 8.1 using my existing kms server? Thanks.

    I would like a yes no clarification answer. So does this mean that EVEN WITH THE PATCH. My Server 2012 Standard edition that currently hosts KMS VA for clients running Win7, Win 8, Office15, Server 2008, Server 2012. Will not be able to host windows 8.1?
    I will have to install 8.1 and use as a host? 
    if you have a KMShost product key for WS2012R2, you can patch a down=level Server and be fine.
    (the OP didn't renew SA or otherwise has no KMShost pkey for WS2012R2)
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)
    I'm having similar issues and have a similar question that doesn't seem to be answered:
    My KMS server is Windows 2008 R2 (Also is my domain controller). I want to activate Windows 2012 R2 and Windows 8.1 machines off this KMS server. I can install the 2012 R2 key just fine but receive error 0xC004F015 (The Software Licensing Service reported
    that the license is not installed) when I try to install my 8.1 KMS key.
    What I'm gathering from this thread is that I have to set up a Windows 8.1 host and set it up to be a KMS server exclusively for activating Windows 8.1. Is this correct? If so, Microsoft needs to fix that. I have a SERVER for activations for a reason: it
    is a server, not a client. If I am mis-understanding, how do I get my Windows 2008 R2 server to accept the Windows 8.1 KMS key for activating 8.1 clients?
    Thanks!
    You don't need Windows 8.1 KMS key. Your 2012 R2 KMS key will be able to activate your Windows 8.1 machines. So your current set up is fine, no need to set up another Windows 8.1 KMS host.
    My problem is I don't have 2012 R2 KMS key as I didn't buy any Windows 2012 R2 license. So I can't use 2012 R2 KMS key to activate my Windows 8.1.
    Oh that's interesting. I guess I need to play around more because my 8.1 test machine isn't activating. I'll start a new thread for that if needed. Sorry for the confusion.

  • How to run windows store app in windows tablet

    Hi,
    I am developing an windows store app I can run my app in local machine.How can i run my app on windows tablets. I am using ASUS windows 8 tablet .How can I connect tab to my pc and run myapp in tablet.
    Thanks,
    Alok

    1) In Visual Studio, create an appx package (Project -> Store ->Create App packages -> Not for upload)
    2) Zip up the folder of the app package
    3) Send to target machine
    4) Unzip app package
    5) Right-click Add-AppDecPackage.ps1 -> Run with Powershell (must be an admin)
    6) Follow prompts for install
    7) Enjoy
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • How do I reinstall notes app?

    My notes app has disappeared?  How do I reinstall? 

    Go to Settings > General > Reset > Reset Home Screen Layout

  • How do i lockout notes app on ipad

    I have 3 Ipads that will be used by children to play games in the dental office.  I don't want the kids using the notes app, calander app, reminders ect.  Can these be restricted?.  I have
    entered restrictions in the general setting but this still allows use of above apps.a

    The only apps that can be restricted are those in the general - restrictions area. Some 3rd party apps do have passwords, however - for notes, I suggest you look at Evernote (which is a more robust note-taking app than the Apple one).

  • How to activate windows screensaver in PDF full screen mode?

    Hey everyone!
    We have some PDF based product presentations that we show on plasma screens. Recently we renewed our computes and switched from Vista to Windows 7, as well as Adobe Reader 9.3 to X.
    Since this change the Windows screensaver doesn't activate when a PDF document is displayed in full screen mode.
    I've already tried to install Adobe Reader 9.3 again, but it seems that this has nothing to do with the Reader version but with Windows 7.
    Can someone please confirm this? I want to get sure this is indeed the case with Windows 7.
    The more important question is: How can I get the sceensaver running again?
    Thank you in advance!

    On Windows, this will be fixed in Firefox 30 (the next release, currently in [http://www.mozilla.org/en-US/firefox/beta/ beta]). In the mean-time there are apparently [https://bugzilla.mozilla.org/show_bug.cgi?id=517870#c35 workarounds].
    For Mac OS X & Linux however, this is not fixed yet.

  • How to activate the deactivated App view in itunes

    Hi,
    I try to sync a new App. It has worked in the past, and I can sync the iphone.
    Now, I have bought/downloaded a new app, I see it in iTunes, I want to sync it, but ...
    The Apps view is frozen/deactivated: foggy vew, I cannot activate/deactivate any button, I cannot click nor move the Apps images on the screen. What is wrong, how can I change that?
    The new app is marked for synchronisation and the image of the App shows up in the display for the iPhone => it looks as if it has been synchronized already, but if I switch on the iphone (or reboot it), it shows the old state without the App.
    Any comments most wellcome.
    d.r.s.

    I've had that view when swapping computers that I synch my iphone to. Are you able to synch music, photos etc. to the device?
    You may get the message this device is synched with another iTunes library, do you want to synch with this one instead (or whatever words), and may have to reinstall things to get it to work again.
    I assume you've tried re-setting the phone.

  • How to activate Windows Server 2012 Datacenter evaluation version with product key provided on MSDN's student account

    Hi,
    I downloaded
    Windows Server 2012 Evaluation Version recently. Actually, I wanted to check whether i could run Windows Phone 8 emulator on Win server 2012 using my core2duo (Non-SLAT PC). Now i wanted to activate the evaluated version by using product key of my
    MSDN's student account. But its giving error when i enter my product key. I checked this article about converting evaluation version to full retail version. The article
    says :
    "If the server is a domain controller, you cannot convert it to a retail version. In this case, install an additional
    domain controller on a server that runs a retail version and remove AD DS from the domain controller that runs on the evaluation version."
    So kindly guide as to how I can install this additional domain controller and how to remove AD DS from domain controller. Currently, I have Dual Boot PC( win 8.1 and win server 2012).
    Hoping to get a brief response....
     

    Unless you have configured a whole lot of things into the DC running on the evaluation copy (should never install production on an evaluation copy), it would be simplest to start from scratch and reinstall. 
    Or, you simply go into Server Manager > Manage > Add Roles and Features to remove the AD role.  Then you will be back to a workgroup server.
    The evaluation version is good for 180 days plus three re-arms of 30 days each.  So you can do a lot of experimenting with the evaluation copy without the need for using an MSDN key.
    .:|:.:|:. tim

  • How to Activate Windows 8.1 Enterprise with Windows 8 Enterprise MAK?

    I bumped into this problem when being assigned to deal with the activation of Windows 8.1 Enterprise.
    There are around 6 notebooks in my team, and they seldom connect to corporation network so are essentially isolated from our KMS server. Therefore we used to install Windows 8 Enterprise and activate these Windows 8's with an Enterprise MAK. However, These
    Windows 8 are going to be upgraded to Windows 8.1 Enterprise but my team is not given the MAK of Windows 8.1 Enterprise. Hence I am going to activate the Windows 8.1 Enterprise with my existing Windows 8 Enterprise MAK.
    To the best of my knowledge, there are 3 ways to upgrade Windows 8 to Windows 8.1:
    Install Windows 8.1 with a Windows 8.1 DVD.
    Install Windows 8 first, and upgrade to 8.1 through an Upgrade ISO.
    Install Windows 8 first, and upgrade to 8.1 through Windows Marketplace.
    I tried method 1 and 2 and found the Windows 8 MAK does not apply to Windows 8.1, in which slmgr -ipk would fail. Method 3 requires a full installation of all available Windows Updates first so I did not try it yet. I wonder if there is any possibility to
    activate the Windows 8.1 Enterprise with a Windows 8 Enterprise MAK. Any reply would be appreciated.
    By the way, my corporation do purchase the Software Assurance. I cannot get the 8.1 MAK due to management issue.

    Seems like it is illegal issue if management is against upgrade ;-)
    I do not think that this is a right way for Enterprise edition. New install is tyhe only option. There are some workaround on Internet, but these are not according to official upgrade path.
    Every multilicense program has its program administrator that could either help or can elevate problem to MS support services.
    M.

  • Activate Window not working in teststand

    Hello,
    I have two small test-Vis.
    What they do is:
    First VI:
    a.) Starting notepad.exe
    b.) get refnum of the notepad-window
    c.) Make it topmost with the lvutil.llb
    d.) Write a text in it with "keybd_event"
    Second VI:
    The Same like in 1.) but without starting notepad (the program is already open.
    When i run this two VIs in labview one after another it works without problems.
    When i run them as Actions in "NI Teststand" then it only works if i run both in "one run".
    But if i cklick first the first vi and "run selected step" and then the second vi with "run selected step" then the second VI only brings the notepad-window to foreground but doesnt activate it. And without activation the text is not written in the notepad-window.
    Is there any trick i can do to always activate the window?
    Im uing Windows2000 /LV 7.1.1 / Teststand 3.1
    Thx for any help.

    Hello,
    I just started working with LabView/TestStand and got a similar Problem.
    I want to activate a certain window (extern executable) and control it by simulating keystrokes.
    I am using the attached VI and implement it as an Action Step in my Sequence.
    The problem is, that ActivateWindow.vi doesn't work in TestStand, although it does when it is running in LabView.
    Any Ideas?
     TestStand 4.1 / LabView 8.5
    Attachments:
    ActivateWindow.vi ‏11 KB

  • How to activate windows xp IN MAC

    I installed xp using bootcamp and activate it. But later windows reminds me every time to activate it when I start XP operation. And when i click OK to follow the activation procedure, it says WINDOWS HAS ALREADY BEEN ACTIVATED. But when i restart it, activation appears again.
    Is there any special setting or protection in the macbook that i have to take care in order to solve the problem about the xp activation?

    Hi and welcome to Discussions,
    never had that problem, but a quick Google revealed that it is not a Mac problem alone.
    Maybe this can help you: http://www.pcreview.co.uk/forums/thread-103782.php
    And found this here: http://forums.techguy.org/t363300.html
    Windows stores the activation information in two files in the c:\windows\system32 folder: Wpa.dbl and Wpa.bak. If those files are locked, or permissions are incorrect, Windows may not be able to save its activation information.
    You might also want to check the following registry keys:
    HKEYLOCALMACHINE\SOFTWARE\MICROSOFTNT\CurrentVersion\Winlogon
    (change Activation Required value to zero)
    HKEYLOCALMACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion
    (change RegDone value to 1)
    Boot into safe mode, click Start→Run and type regedit then check these values.
    Hope it helps you.
    Stefan

  • How to activate Windows To Go from Intune Software Assurance

    We recently decided on using Windows Intune with Software Assurance to create Windows To Go drives for some of our employees as they would like to work from home on computers running Windows XP and Windows Vista.
    We are using the PowerShell option and the Install.WIM file from the Enterprise ISO available on the Windows Intune Software Assurance download page.
    We are running into a problem when activating Windows To Go. We receive an error "DNS name does not exist" when trying to activate. We are building this off of an installation of Windows 8 Enterprise that was received thru Windows Intune Software
    Assurance. Additionally, we are using the Dism.exe for imaging the drives.
    What are we doing wrong?
    It's important that I note, the machine we are building the Windows To Go images from does not have an internet connection and therefore has not been activated. I was thinking this may be related to our problem but I figured I would as to see if there
    may be some other condition we are missing.
    Furthermore, I should mention, we are not taking a snapshot of the machine to create a custom WIM file. We are using the raw WIM from the Enterprise ISO. Could this be the cause as well?
    I also thought that perhaps we needed to activate the machine we are building from first, then create a custom WIM image of that activated machine and use an activated WIM image file for the Dism process, but then I also considered that if I do that, I have
    to run Sysprep which would reset activation, correct?
    The Windows To Go image already has Windows Intune installed prior to attempts for activation so I know it's not that.
    Any help would be greatly appreciated.
    Owner, Quilnet Solutions

    I know this is very old but I’m trying to clean up old posts. Did you ever solve this? If so it would be good if you could post the solution to assist others. If not, at this
    stage, as nobody has answered, I would recommend that you call Intune support.
    You will find your local Intune support number here
    http://technet.microsoft.com/en-US/jj839713.aspx
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • Lotus Notes delete my Notes.app how can I recover?

    I Install Lotus Notes for mail for my office and now I dont have Notes.app cause Lotus Notes have the same name, I think!... how can recover the Notes.app?
    Any Idea?
    Thanks

    copy it from a backup or other same-OS mac - or reinstall the OS then make a copy first.
    You might type 'Notes' into Spotlight just in case Lotus did the right thing & backed it up somewhere.

  • Please activate Windows

    Hi, I recently upgraded my new Acer ultrabook to Windows 8. After having windows 8 for a few days I came across many problems. I researched the problems and I was told to "Refresh my PC" This fixed the problems however my computer now tells me
    that Windows is no longer active and my product key is being used with another computer. This prevents me from downloading any apps and always annoyingly pops up telling me to activate Windows. The product code I purchased "Is already in use with another
    PC" after using the "Refresh my PC" setting, any help?

    Try activating by phone.
    How to activate Windows 8 by phone
    Press Windows key + X then click Run, then type:   slui.exe  4
    Next press the 'ENTER' key.
    Select your 'Country' from the list.
    Choose the 'Phone Activation' option.
    Stay on the phone *** do not select/press any options *** and wait for a person to help you.
    Explain your problem clearly to the support person.
    =========================================================
    How to contact a Microsoft Product Activation Center by telephone:
    http://support.microsoft.com/kb/950929
    For a list of phone numbers see method #1
    J W Stuart: http://www.pagestart.com
    Never be afraid to ask. This forum has some of the best people in the world available to help.

Maybe you are looking for