Missing middle of script

okay heres the script i currently have
set theWiFi to do shell script "wifi=`system_profiler SPAirPortDataType|awk -F\": \" '/Current Wireless Network/{print \"\\ \"$2}'`
ifconfig | awk '/flags=|media|inet / {if (substr($2, 1, 6) == \"flags=\") printf(\"
%s \", $1);
else if ($1 == \"inet\") printf(\"%s \", $2);
else if ($1 == \"media:\") printf(substr($0, 9))}' | awk '$1 ~ /^en/'
echo $wifi
tell application "Finder"
activate
open application file "VPNClient.app" of folder "Desktop" of folder "DP" of folder "Users" of startup disk
end tell
the first part of the script finds the network name, and second part opens the VPN client application, but i need a way to connect the two parts of the script so that when its connected to the wireless network 'pennstate' it opens the VPN client but if its connected to anything else, it just ends the script, any ideas? thanks in advance

Your shell script doesn't work for me, but I'll assume that it returns the appropriate name you're looking for. If so, the request:
i need a way to connect the two parts of the script so that when its connected to the wireless network 'pennstate' it opens the VPN client but if its connected to anything else, it just ends the script
is trivial:
Instead of:
tell application "Finder"
activate
open application file "VPNClient.app" of folder "Desktop" of folder "DP" of folder "Users" of startup disk
end tell
Just use:
if theWiFi = "pennstate" then tell application "VPNClient" to activate
You don't need the Finder to launch an application - just activate the app in question. The addition of the 'if theWifi...' part takes care of checking if you're on the right network.

Similar Messages

  • InDesign CS4 Middle Eastern Scripting Documentation?

    Can anyone please give me a link to documentation for scripting the ME version of InDesign. I'm sure I've seen it somewhere, but I'm not managing to find it.
    Many thanks,
    Ariel

    This is not the first time that as soon as I've asked a question, I've found the answer. Weird.
    Anyway, if you've got the ME version installed, the documentation should be here (on Windows):
    C:\Program Files\Adobe\Adobe InDesign CS4\Scripts\ScriptingME\documentation
    The PDF is called "Middle Eastern Scripting Guide"
    Thanks,
    Ariel

  • Auto replace missing fonts durring script place

    I have a script that runs on startup that places a word document in a new indesign document. The problem is that if there are fonts in the word document that indesign can't find, then we get a message saying there are missing fonts and a series of javascript errors because there's a dialog open.
    Is there an option to have it automatically replace missing fonts with a specified font?
    InDesign CS5
    Windows

    Form my understanding you can't replace missing fonts until the document is open. To avoid the missing fonts modal dialog, you can set
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    before opening the document and then make your font substitutions. Don't forget to reset the userInteractionLevel when your script is done!

  • What am I missing in this script?

    Hello
    I am quite new to applescript and I am trying to develop an applescript for use with a filemaker database that I have been tasked to upgrade with new functionality. While learning how to do certain things I stumbled across the following:
    I create this script and run it...
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    *end if*
    *end tell*
    Works as expected. Mounts the server giving access to the desired folder. Now I run this next script...
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *tell application "Finder"*
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end tell*
    Works as expected and tells me that the desired folder is accessible.
    But now I put both bits of code in the same applescript and run it, as so...
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    *end if*
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end tell*
    ...and I see the server briefly mount, then dismount, then the script blithely informs me that there is no access, of course. What am I missing in all of this? I had thought that perhaps it was an issue of needing to delay the next check and created a delay mechanism right after the mount statement but no matter how much time I give it it fails to mount and/or stay mounted. Any ideas?
    Thanks,
    Matt

    Hi.
    I'm not sure if the following will make any difference as I don't have a server handy to experiment with, but you might like to try them to see if it helps.
    1. You mentioned that running one script and then the other gave the hoped-for results, but the combined version did not. Rather than omitting the "end tell" from the end of the first script and omitting the "set mountedFolder to "Our_Files:Analytical Results:" " and the "tell application "Finder" " from the start of the second script when combining the two scripts (what you did seems logical - combining two Finder tell blocks into one), have you tried simply pasting the second script (in its entirety) after the first (also complete) so that the combined script now looks like the following? My idea is that it runs one then runs the other, without changing any code.
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    *end if*
    *end tell*
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *tell application "Finder"*
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end tell*
    2. Another thing to try is the following slight modification to your original combined script - you could try it with and without the "else".
    *set mountedFolder to "Our_Files:Analytical Results:"*
    *set myConnectionString to "afp://MyAccountName:[email protected]/Our_Files/Analytical Results/"*
    *tell application "Finder"*
    *if not (exists mountedFolder) then*
    *mount volume myConnectionString*
    else
    *if exists folder mountedFolder then*
    *display dialog "The volume \"" & mountedFolder & "\" IS mounted!" buttons {"OK"} default button 1*
    else
    *display dialog "The volume \"" & mountedFolder & "\" is NOT mounted. Please reconnect." buttons {"OK"} default button 1*
    *end if*
    *end if*
    *end tell*
    I don't know if either of these suggestions will help, but I basically learn by adapting and expanding existing scripts and trying things various ways until I get the result which I want. Good luck.

  • Missing dbmsxsu.sql script

    Hi,
    I am running oracle version 10.2.0.1.0. I am presently trying to activate the xml database that is initially installed with the normal one. When I run this script catqm.sql or initxml.sql the following script listed below with the path is not there when called:
    /u01/app/oracle/product/10.2.0/Db_1/rdbms/admin/dbmsxsu.sql
    as part of the steps in standing up the database oracle throws an error. Upon looking into the directory where it is suppose to be I find that it is not listed. Is this an oversight on oracle's part and how do I go about correcting this situation? Is there a patch for this?
    Any help on this matter would be appreciated.
    Thanks in advance.
    al

    iFS runs on Oracle 8.1.6 and above.
    So, the file is missing because you are using
    an old version.
    By the way, it is necessary because iFS depends on the Java capabilities of
    Oracle 8i.
    -John

  • Text element missing in the script

    We have standard print program, calling a zform and z subroutine. The values are flowing in the outtab itcsy structure. but when flowing thru the form, it gives the error message, text element 625-TX is missing in the Z window.
    What could be the problem?

    Hello,
    The Text element is missing the that window.
    Some the print program the element 625-TX is called using write_form.
    Please inlcude this text ele in that window.
    Cheers,
    Vasanth

  • Bayside Beat tutorial missing a java script in the files

    So I opened the file and I unzipped it.  Figure 4. http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/dreamweaver/articles/ first_website_pt1/first_website_cc_pt1_fig04.jpg
    shows a JS and it is not in the file...I'll work around it, but want to know if is a problem.

    The HTML5 shiv is hosted on Google Code's CDN.   You can safely link to the external file to save having to download & host it yourself.
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    Nancy O.

  • Missing bridge startup scripts

    In bridge CS4 I am trying to use the Output feature to create a PDF contact sheet. However, when I click on that, I get a new workspace but I get no features in the output panel, it's blank. In reading the bridge PDF help manual, it says that one should use the Adobe Output Module script to do this: "If the Output workspace is not listed, select Adobe Output Module in Startup Scripts preferences." However, when I go to Preferences, Startup Scripts, and select "reveal scripts" there are no scripts shown at all.
    Where can I find them? Is this also why when I select the "Tools" menu item, there is no "Photomerge" choice?

    I have gone to Bridge->Preferences->Startup script panel. The Adobe Output Module is not listed. In fact, there is nothing listed in the panel.
    I have installed Photoshop CS4 but the photomerge options do not appear on the Tools->Photoshop menu of Bridge as they did in CS3. The only choices that appear are "Batch rename", 4 Metadata items, and "Cache".

  • Soa11g  - missing middle tier ?

    hello ...
    first sorry my chaotic question, but im total beginer.
    I've got installed working SOA11g environment . everything was started from admin console and works fine (developers confirm). But after computer restart is something wrong. all aplications are down. Server Error 404--Not Found . SOA is started as usualy by link Start AdminServer for weblogic domain from windows start menu and then starting servers BAM and SOA from adminConsole.
    In AdminConsole - domain - servers is running AdminServer, Bam-server1, Soa_server1 all in running state.
    in EM11g http://server:7001/em everythign except adminserver is unavailable. Status of BAM and SOA is down (red arrow). I can start,stop server from EM and in server summary screen state Running and Health OK. everything else is unavailable.
    all deployed applications are down and their status is unvailable.
    comparing with another server with same SOA11g installation there is another server in list - servername_server. I think it weblogic middle tier. This instance is not present on problem server.
    I cant find what hapens and how to solve my problem.
    Can you please give my some hints for this ?
    Thanks for any hint.

    try to restart your admin server, it looks like you have deployed your applications to admin server, this will resolve the issue. If the admin is not coming up check on the .DAT files in the domain_home/servers/AdminSevers/data/default & diagnostic folders and remove them and restart it. Check if there are any other admin process ( zombie ) running and kill them and restart the admin.

  • InDeSign Server - Flex - SOAP - Business cards tutorial - MISSING Arguments for Script

    Hello, <br /><br />I test even Adobe Flex with InDesign server. I am occupied with<br />the Business cards tutorial. The Problem is, which no arguments are<br />transferred to servers at InDesign. The Script is executed and the new document and the pdf are produced.<br />But without contents!? Is the error situated in it WSDL file? Here my<br />data:<br />InDesign Server Port = 8070<br />Mac Localhost = http://localhost:8888<br />The IDSP Root = http://localhost:8888/IDSP.wsdl<br /><br />IDSP.wsdl Content<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><definitions name="Service"<br /> targetNamespace="http://localhost:8888/IDSP.wsdl"<br /> xmlns:tns="http://localhost:8888/IDSP.wsdl"<br /> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"<br /> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"<br /> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br /> xmlns:xsd="http://www.w3.org/2001/XMLSchema"<br /> xmlns:IDSP="http://ns.adobe.com/InDesign/soap/"<br /> xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"<br /> xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"<br /> xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"<br /> xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"<br /> xmlns="http://schemas.xmlsoap.org/wsdl/"><br /> .........<br />......<br /><service name="Service"><br /> <documentation>gSOAP 2.7.8c generated service definition</documentation><br /> <port name="Service" binding="tns:Service"><br />  <SOAP:address location="http://localhost:8070"/><br /> </port><br /></service><br /><br /></definitions><br />  <br />Flex MXML Content:<br /><br /><?xml version="1.0" encoding="utf-8"?><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><br />     <mx:WebService id="wsIDSP"<br />          wsdl="http://localhost:8888/IDSP.wsdl"<br />          endpointURI="http://localhost:8070"<br />          useProxy="false"><br />          <mx:operation name="RunScript" resultFormat="e4x"><br />               <mx:request><br />                   <runScriptParameters><br />                      <scriptLanguage>javascript</scriptLanguage><br />                      <!--Optional:--><br />                      <scriptFile>/Volumes/Macintosh HD/Applications/Adobe InDesign CS3 Server/Scripts/myScripts/businessCards.jsx</scriptFile><br />                      <scriptArgs><br />                     <scriptArg><br />                         <name>name</name><br />                         <value>{nameInput}</value><br />                    </scriptArg><br />                    <scriptArg><br />                         <name>company</name><br />                         <value>{companyInput}</value><br />                    </scriptArg><br />                    <scriptArg><br />                         <name>title</name><br />                         <value>{titleInput}</value><br />                    </scriptArg><br />                      </scriptArgs><br />                   </runScriptParameters><br />               </mx:request><br />               <br />          </mx:operation><br />     </mx:WebService><br />     <mx:Script><br />          <br />              [Bindable]<br />              public var nameInput:String="";<br />              [Bindable]<br />              public var companyInput:String="";<br />              [Bindable]<br />              public var titleInput:String="";<br />              <br />              private function makeCards(name:String, title:String, company:String):void<br />              {<br />                   nameInput = name;<br />                   companyInput = company;<br />                   titleInput = title;<br />                   <br />                   wsIDSP.RunScript.send();<br />              }<br />          <br />     </mx:Script><br />     <mx:Form width="410" height="277" x="46" y="34" horizontalScrollPolicy="off"><br />          <mx:FormHeading label="Business Card Information"/><br />          <mx:FormItem label="Name"><br />               <mx:TextInput id="textName" width="100%" /><br />          </mx:FormItem><br />          <mx:FormItem label="Title"><br />               <mx:TextInput id="textTitle" width="100%" /><br />          </mx:FormItem><br />          <mx:FormItem label="Company"><br />               <mx:TextInput id="textCompany" width="100%" /><br />          </mx:FormItem><br />          <mx:FormItem x="75"><br />               <mx:Button x="150" label="Print Cards" <br />                         click="makeCards(textName.text, textTitle.text, textCompany.text)"/><br />          </mx:FormItem><br />          <mx:Text x="47.5" y="194" text="{wsIDSP.RunScript.lastResult.errorNumber}" width="383" height="20"/><br />          <mx:Text x="47.5" y="224" text="{wsIDSP.RunScript.lastResult.errorString}" width="381" height="20"/><br />          <mx:Text x="47.5" y="254" text="{wsIDSP.RunScript.lastResult.scriptResult.data}" width="383" height="24"/><br />     </mx:Form><br /><br />     <br /></mx:Application>

    I am curious where you got the tutorial, and which version of InDesign Server you are using. Also, can you show the contents of the businesscards.jsx script?
    In the meantime, it seems like the connection from Flex to InDesign is working since your script is running and producing output. The next step is to check the arguments being passed to the script, and how the script is accessing and using the arguments.
    You can add this to your jsx script to test the values of the arguments:
    var myName = app.scriptArgs.IsDefined("name") ? app.scriptArgs.getValue("name") : "name undefined";
    app.consoleout("scriptArg name = " + myName);
    var myCompany = app.scriptArgs.IsDefined("company") ? app.scriptArgs.getValue("company") : "company undefined";
    app.consoleout("scriptArg company = " + myCompany);
    var myTitle = app.scriptArgs.IsDefined("title") ? app.scriptArgs.getValue("title") : "title undefined";
    app.consoleout("scriptArg title = " + myTitle);
    To see the values, watch the InDesign Server console window. If you are not getting the values you expect, check your mxml code to make sure the variable names are valid, etc. If you are getting the values you expect, examine your businesscards.jsx to make sure you are using the values as required to populate the InDesign document.
    Susan

  • Missing asmcmdcore perl script from 10.2.0.1

    I am not able to run asmcmd from a command prompt(Windows) it complains that it cannot find the perl script asmcmdcore. I have added the ORACLE_HOME\bin to my path.
    I am running windows 2003 enterprise 64 bit (AMD) service pack 2. I suspect that I am running into 64 bit issues. Where would I find the filethat I need?

    did you run a search for the file under the Oracle Home? Check your env (specifically Path) from command by issuing set.
    C:\set

  • CS6 form validation script code does allow return to form o get missing entry and then sends

    When submitting a form with a missing entry the validation code missing info popup window works correctly. However when you click OK to return to the form to correct it, the form is sent and doesn't return to correct the information. Something is missing in the Script code. I am using CS6 and the form validation software.
    Jad92009

    I am using the software that comes with CS6 for designing and validating a form. I am not using Spry. Following is the code and the script:
    <input name="submit" type="submit" onclick="MM_validateForm('first-name','','R');MM_validateForm('last-name','','R');MM_vali dateForm('company','','R');MM_validateForm('zip-code','','NisNum');MM_validateForm('phone- number','','RisNum');MM_validateForm('email-address','','RisEmail');return document.MM_returnValue"   value="Submit" />
    <script type="text/javascript">
    function MM_validateForm() { //v4.0
      if (document.getElementById){
        var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
        for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
          if (val) { nm=val.name; if ((val=val.value)!="") {
            if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
              if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
            } else if (test!='R') { num = parseFloat(val);
              if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
              if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
                min=test.substring(8,p); max=test.substring(p+1);
                if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
          } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
        } if (errors) alert('The following error(s) occurred:\n'+errors);
        document.MM_returnValue = (errors == '');
    </script>
    the URL is http://ddi.netouch.com/form-design-support1.asp.
    Your help would greatly appreciated.
    Jim

  • Re Trim file name scripts in SL

    Below is a frozen, unanswered conversation regarding the missing finder scripts in SL. Luckily, I make a complete backup before converting, so I still have all the old Leopard scripts. Norwichfan, I feel your pain, and I thought that archiving your thread without an adequate answer was wrong.
    Here's your answer. you can just get a copy of the old finder scripts, put them in /Library/Scripts and they'll show up in your script menu as before. I have zipped up a copy of them and posted them here:
    http://tedward.org/finder_scripts.zip
    norwichfan88
    Posts: 12
    From: Australia
    Registered: Mar 25, 2010
    Trim file name scripts in SL
    Posted: Mar 26, 2010 6:26 PM
    I have recently upgraded to SL and have found that the trim/add to file name applescripts from leopard are missing from my scripts menu.
    Is there a place I can find these for SL?
    MBP mid-2009 Mac OS X (10.6.2)
    Pierre L.
    Posts: 824
    From: Québec
    Registered: Jan 26, 2009
    Re: Trim file name scripts in SL
    Posted: Mar 26, 2010 6:49 PM in response to: norwichfan88
    Solved
    Maybe something similar in this web page?
    15-inch MacBook Pro 2.53 GHz Mac OS X (10.6.2) AirPort Extreme
    norwichfan88
    Posts: 12
    From: Australia
    Registered: Mar 25, 2010
    Re: Trim file name scripts in SL
    Posted: Apr 10, 2010 12:03 AM in response to: Pierre L.
    Thanks for the web page, had a look but not having done any work with applescript or other programming language was a bit over my head.
    I decided to make a temporary solution with and automator action.
    MBP mid-2009 Mac OS X (10.6.2)

    Thanks for the web page, had a look but not having done any work with applescript or other programming language was a bit over my head.
    I decided to make a temporary solution with and automator action.

  • Files in Adobe support folder missing?

    I've suddenly had a message appear when I open Photoshop CS6 saying "one or more files in the Adobe support folder, necessary for running Photoshop are missing.  Please run the Photoshop installer and re-install Photoshop".  When I press o.k. button I can continue to use Photoshop mostly without issue.  This message only comes up on initial opening the application.  Any ideas?

    All solved!!
    There was a file missing in my Scripting Editions Library folder.  I just copied from a previous back up and pasted in current library and message has now gone when I open up Photoshop.

  • Setting Timeline Markers Script in After Effects CS6

    So I'm without my desktop computer for the time being and am using a laptop in its place-which means I do not have access to a numpad. Going out to buy one is my last resort, as I don't have enough leisure time to visit a trusty electronics store. So I downloaded keyED Up, by Jeff Almasol, and I can change shortcuts at will-truly a useful tool. Yet, while I can change all other shortcuts, I found that the "set timeline marker tool" which is typically the "asterisk" key on the numpad is missing from the script list, and the marker list only includes "set composition markers 1-8," and "go to composition markers 1-8." Is this a discrepancy only in my keyEd Up script, or is it not an available option? Is there any other simple way to modify the "set timeline marker" shortcut?

    See this:
    Alternate keyboard shortcutd

Maybe you are looking for

  • Subracting dates at report level , to get difference in days.

    Hi team, I have 2 Key figure End date & start date & I need to present a difference between these dates in form of days . Firstly it is possible at report level , by using process value as date [DATE] on both the end & start date fields , later subtr

  • Hard drive space

    i just deleted all my itunes music on my mac about 50gb but my hard drive its showing full.

  • Issue when I copy a role of ESS and MSS in the portal

    Dear Experts- I have the following issue. We have copied the role of ESS for the users. However we are implementing ESS for several Country and for this we copied the role of ESS Standard. However when we do this whe system created this role for the

  • Convert labview 5.1 R&S SMG driver to 2009

    I need help in converting this driver from 5.1 to 2009. Thanks! Solved! Go to Solution. Attachments: rssmhu_lv5_1_0.zip ‏747 KB

  • Mutilple Hint Captions

    Hi, Is there any way to get "Multiple Hint Captions" on a single button ? -Raj