How to make script depended on specific network???

I hope that someone can help me with this. I do not yet have much experience with scripting, but I made a script which connects my macbook to a folder on my NAS. However, if my local network is not available the script will hang itself waiting until it can mount. Also limiting the repeat loop does not help since it will still hang within the loop. I was just wondering if I can start the script with a command which says that the script should only be executed if connected to a certain ip adress or Network-name. This is my script sofar:
tell application "Finder"
repeat
if not (exists folder "Backup" of desktop) then
try
mount volume "afp://user:[email protected]/Backup"
end try
end if
if (exists folder "Backup" of desktop) then exit repeat
end repeat
end tell
Thanks for any help in advance!

Thanks, that's helpful! Reason of the repeat is that the real script contains three folders to which the computer has to connect. Sometimes the computer/NAS is still busy doing something else so it needs an extra attempt before connection is made.
By the way, for those who are interested, I seem to have managed to make a script to check for the network first:
set myIP to (do shell script "system_profiler SPAirPortDataType|grep -e 'Current Wireless Network:'")
if myIP does not contain ("Current Wireless Network: xxx") or myIP contains ("turned off") then error number -128

Similar Messages

  • HT201270 MORNING COMMUNITY, anyone know how to make the i4s forget a network - when the device won't give you that option?

    MORNING COMMUNITY, anyone know how to make the i4s forget a network - when the device won't give you that option?

    if you dont have the options to forget network you can reset your network settings, but than the device forget all networks
    settings > general > reset > reset network settings

  • Hi Experts.. How to make scripts & SmartFrom Unicode enable

    Hi Experts..
    How to make Scripts & Smart From Unicode enable? i know for scripts we need to check with driver program & 
    For smart from we need to check the generated function module. Correct me if am wrong. 
    I wanna to know how to make layouts & from Unicode conversion....or enable??
    Thanks In Advance
    Santosh.S
    Points for sure ...

    Hi Donghai,
    Have you tried using the command
    CHAIN ENDCHAIN.
    Try displaying the message for te field you wish to within CHAIN and ENDCHAIN which will allow you to enter the data in the field even after the error message is displayed.
    Caution: Mention all the field names in CHAIN and ENDCHAIN which you want to be open for enterin the values into it.
    Thanks and Regards,
    Kunjal Patel

  • How to make script faster

    Hi,
    I have a table with huge volume of data. I am doing following activity using SQL script
    1). alter table my_tab add new_col NUMBER(10);
    2). update my_tab set new_col= 50;
    3). alter table my_TAB modify new_col NOT NULL;
    4). Create index on my_tab(new_col);
    Above scrip is taking around 10 hours to excecute.
    Could any one please suggest how to make it fast.
    Thanks.

    amit_hum wrote:
    Hi,
    I have a table with huge volume of data. I am doing following activity using SQL script
    1). alter table my_tab add new_col NUMBER(10);
    2). update my_tab set new_col= 50;
    3). alter table my_TAB modify new_col NOT NULL;
    4). Create index on my_tab(new_col);
    Above scrip is taking around 10 hours to excecute.
    Could any one please suggest how to make it fast.
    Thanks.You haven't told us your database version.
    You haven't shown us the details of your table structure or an example of the data, or even how many rows is a "huge volume of data".
    Without proper information we would just be guessing and that doesn't help anybody.

  • How to make a computer invisible in  network?

    I was amazed that in the left-hand panel of FINDER, under the SHARED tab, there are about 6 other computers that I am seeing. I am concerned that others may be able to access my computer via my wireless connection. How can I make sure I am protected, and my computer is invisible to them?

    Go to System Preferences > Sharing > uncheck everything in the left window. If you're not sharing anything you won't show up.
    Regards

  • How to Make JTextField Accept Only Specific Numbers?

    Hello There
    I've made 3 JTexfields That accepts only Numbers
    But I Want To Make Them Accpets Numbers only from 1 to 12
    and if the number is greater than 12 they don't accept it?
    another Thing That I've Set Their Columns To 2 meaning that i want the user to enter only two numbers
    but yet the user can enter many numbers how would i restrict entering numbers to only two numbers?
    here's my code:
      import java.awt.*;
      import javax.swing.*;
      import javax.swing.text.*;
      public class ManyText extends JFrame{
           public static void main(String[]args){
           JTextField[ ] text = new JTextField[3];
           JButton button=new JButton("Press");
        for(int i = 0; i < text.length; i++)
         text[i] = new JTextField(3);
         for(int i = 0; i < text.length; i++){
         text.setColumns(2);     
    text[i].setDocument(new PlainDocument(){
    public void insertString(int offs, String str,
    AttributeSet a) throws BadLocationException{
    if("0123456789".indexOf(str) < 0)
    java.awt.Toolkit.getDefaultToolkit().beep();
    return;
    super.insertString(offs, str, a);
         JFrame f=new JFrame();
         f.setSize(200,200);
         f.setLayout(new FlowLayout());
         f.add(text[0]);
    f.add(text[1]);
    f.add(text[2]);     
         f.setVisible(true);     

    ejp wrote:
    Actually I would suggest you're using the wrong control. I would use a JComboBox or a JSpinner for this.I suggested he use a JSpinner 1-2 threads ago. Maybe if he hears it enough, he'll believe it.

  • How to make a INTERNET ONLY wifi network for guests at a business..

    hey guys/gals:
    im trying to set up a public network for guests at my business. i only have one internet subscription for the building and a big server and several switches in the basement providing wired 100base-T network connections to all my computers. they are all on the same network and domain. 
    now i want my guests to have internet access ONLY. I don't want them to even be able to see any of my printers, computers, servers or anything! just the web. what equipment do i need and how do i set it up?
    -thanks in advance

    You can use the Wireless router or the Access point to provide the wireless network.However,there is no such option on these devices.
    Guest user can not access your computers,printers or servers unless or until you give "Sharing" permission to them.So if enable sharing and give permission then only the Guest user can share your computers or printers.

  • How to make MAC print to an network printer on a non default port.....

    Hello
    I have a Gestetner 3235PCL printer at the office. The printer is on IP address 192.168.1.10 using Port 9101.
    I can't seem to find a way to make the computer print to anything but the default port.
    Any ideas if this is possible using a Mac?

    Bruce is correct, but be certain you select IP > HP Jetdirect-Socket. Then enter the IP address with the port number separated by a colon " : ".
    You could also use the CUPS web page to add the printer. At the Device menu, select 'Appsocket/HP Jetdirect' and then at the Device URI menu, after socket you can enter the IP address with port 9101, such as
    socket://ip_address:9101/
    Do you know if the printer is using a Fiery controller? I know the Fiery's offer three ports alternate to 9100 so that you can connect to a specific queue. 9100 will print to whatever has been selected as the default queue in the controller config, such as print, while 9101, 9102 and 9103 are the direct, print and hold queues respectively.
    Pahu

  • How to make FireFox work on Mobile Network APN?

    Firefox for Android Mobile latest version well when on WiFi, but is not able to detect Internet connection when on Mobile Network (through APN).
    Thanks!

    Make sure of your Access point settings

  • How to make a directly usable Bluetooth network location

    I've configured a Bluetooth modem to use as a modem to
    connect to the Internet. I've defined the secured pairing
    between my Mac and my mobile.
    I've defined a network location to connect through Bluetooth
    with my mobile phone.
    Everything is working correctly in three steps:
    1. switch to the Bluetooth network location,
    2. turn Bluetooth on in the menu bar,
    3. select Connect in the phone drop down menu (in the menu
    bar).
    What is the simplest way to make all this process a one step
    one:
    1. switch to the Bluetooth network location ?
    On the other hand, when I have to leave this connection,
    everything is working correctly, except that the Bluetooth
    connection stays up. Hence I have to turn Bluetooth off
    in the menu bar. Otherwise there is a serious useless
    but endless microwave activity, power consumption and
    security problem. My Bluetooth connectivity is still up!
    What is the simplest way to make the switching to another
    kind of physical connection switch off the other ones?
    dan    

    SQL> set autotrace on explain
    Run the query to see if the index is used, use a where clause to
    select * from table where indexed_column=value;
    Cheers
    Justin Miles

  • How to make powershell script.

    How to make script that copy content from notepad to other notepad and reverse the text?

    If you mean a .txt file then there's three aspects to your question.
    Open a file and read the text
    Reverse the text
    Save the text into a new file
    For point one, this technet article is good:
    http://technet.microsoft.com/en-us/library/ee692806.aspx
    For point two you could turn the text into one or more strings, then convert those into arrays, loop through them and then re-assemble them. This article shows you most of that:
    http://technet.microsoft.com/en-us/library/ee692804.aspx
    And finally you need to save that text as a file, there's lots of ways but the Out-File cmdlet is the simplest.
    This might also be of use:
    http://www.ehow.com/how_7174023_write-basic-powershell-script.html

  • How to make AE script folder?

    Hi, i want to ask something about script in after effect CS6. I have many script in my AE and I think its quite difficult to find the script i want. So, how to make script folder in AE or maybe group of script? So if I want to use the script i can find it easier....
    Thank you and sorry for my bad english...

    // create a new FolderItem in project, with name “comps”
    var compFolder = app.project. items.addFolder(“comps”);
    AE CS3 Scripting guide, page 78

  • How to make a disclamer for groups of users

    I have a client with a specific requeriment:
    He need make one specific disclaimer for a group of users (corporative accounts). I know how to make this to all users (configuration of smtp_in and smtp_out process), but I dont know how to make this for some specific users :(.
    Thanks for your help, Adail Horst

    I am trying to display the user name and groups he belong to based on samplesales dashboard. Hence no LDAP/external table authentication.

  • How to make a selection of a layer delete content and paste another content with Photoshop scripting..?

    how to make a selection of a layer delete content and paste another content with Photoshop scripting..?

    There is a more specific Forum …
    Photoshop Scripting

  • HT203909 Why can't you provide specific instructions here about how to make the USB drive bootable?  The article referenced is not dedicated to Bootcamp--too long, too many options.  How do you make it bootable?

    Why can't you provide specific instructions here in HT203909 (Boot Camp: Creating an ISO image from a Windows installation DVD) about how to make the USB drive bootable?  The article referenced for partitioning the drive is not dedicated to Bootcamp--too long, too many options.  How do you make it bootable?

    If your BC Assistant shows the option to create a USB Installer, it automatically is marked as bootable. There is no need to have manual intervention to make a bootable USB. Once the process is manually modified, it is supported by the person modifying it.
    You have two or three options (depending on your Mac Model).
    1. Create USB... - Use a USB2 flash drive, which is erased and formatted. If your Mac supports ISOs then BCA will prompt for the Media. Any Mac which does not have a built-in Optical drive will support an ISO. There are specific Mac models which support both, DVD and USB based installation.
    2. Download Software from Apple servers...
    3. Install Windows...
    Are any additional instructions really necessary?

Maybe you are looking for

  • How to supress alert "There is no application set to open URL *custom_protocol*://-" on Safari 7.0

    There are no any problems with Safari 6.1, Firefox and Chrome. To supress alerts(application not yet installed) I'm using something like this window.alert = function(title, message) {   //disable all alerts! And this   var prepareLauncherBase = funct

  • Can SCCM Manage/Wipe SD Card on the Lumia Phone ?

    Hi We are deploying Windows Lumia 735 in our company but there is not much storage left for the user to store photos , about 2 GB. We are using SCCM/Intune to manage the devices and we want to make sure that any photos , document on the SD Card can b

  • Question about multiple CD/DVD-ROM drives..

    One CD/DVD reader, one CD/DVR burner. I like having two, but there is only one CD power port (JCD1). Am I missing something? Also, should I master/slave them and put them under IDE1 or separate the two between IDE1 and IDE2? Thanks for the advice.

  • How to update using multiple languages.

    I am using Eclipse and TomCat to a Oracle 10g database. Using SQL developer I can enter multi-language characters into the nvarchar2 columns. My application creates SQL update Strings that look like this: update CLIENTINCUMBENT set UNITCODE = UNISTR(

  • Missing fonts report

    Dear All, Please see the code below, I am trying to generate package report. But it is not getting generated. Please give me some suggestion what to do. set source_folder to choose folder with prompt "Select folder containing InDesign Documents" tell