Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to do IP-based mounting and indexing' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to do IP-based mounting and indexing
Authored by: lar3ry on Feb 15, '07 04:37:30AM
There is a line that reads:
-- alter this to work with your above changes.on doMounting()
Split the line after the period and before the word "on."

I've done similar things based on IP address, but since my work IP is DHCP and relatively random, I check via regular expression, although checking via netmask would be just as usable. Applescript doesn't have all the juice needed for this, but if you augment with shell scripts, you can do quite a lot of things.

I needed to modify my script for a special case where I traveled somewhere and the IP address I received made it appear that I was at home. I got around this by making a tweak to do a "one shot ping" of a system that should be always reachable on my home LAN in order to differentiate between being "home," "in the office," or "visiting."

Doesn't that sound like network "locations?" [smile]

I can think of some other interesting things that such a script can do, once it knows where you are:

  • Play a shell game with Finder aliases so that my Finder sidebar "Favorites" contains things that I would normally use at that particular location.
  • Set the networking Location, if applicable.
  • Set up Quicksilver or Butler shortcuts that are applicable to the location.
The list is really limitless, depending on your needs. Perhaps somebody will create some sort of utility so that people don't need to be programmers to do this fancy stuff!

As for the script presented, I honestly never considered turning Spotlight on the shares I mount. Silly me! (And great idea! I may add that to my own script!)

[ Reply to This | # ]