• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reply to Answer to Mounted Network Drives
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reply to Answer to Mounted Network Drives


  • Subject: Re: Reply to Answer to Mounted Network Drives
  • From: "Richard @ Beaver Promotions" <email@hidden>
  • Date: Fri, 5 Feb 2010 09:58:53 +0000

Hi Chris,

I tend to use Applescript over Automator these days.

Open Script editor from Applications and paste the following code in the window.

Suggestion no.1: 

tell application "Finder"
try
mount volume "smb://username:windowspassword/SharedFolder" -- Reach MS Windows Network Shared Folder
mount volume "smb://ormachinename:windowspassword/SharedFolder" -- Reach MS Windows Network Shared Folder
    mount volume "afp://username:macpassword@usermachine?.local/SharedFolder" -- Reach Mac Shared Folder
end try
end tell

Configure the above as necessary.

Save this somewhere.  Then click Save as; click save as Application, uncheck Start Screen and check Run Only, press save button.

Now open System Preferences, click Accounts, click Login Items, go to the location where you saved the Run Only file and drag this into the Logins Items.

Finally check the Hide option.

Now whenever you start your machine these volumes will automatically mount if available.

Of course you can run the script at particular times or whatever via iCal as necessary.

Suggestion no.2:

Similar to above, but keep the volume paths stored in a config text file, mount this volume and read it line by line mounting the volumes.
Less administration.  When people change their machine name, shared folders or password you just have to change this one config file from one host machine.

Hope this helps, if you need help with suggestion no.2 google 'applescript readfile' for the read file routine.

I learnt everything I know from using google with keywords 'applescript <what i want to know>' ... lol works for me ;-)

----

Rikki

On 4 Feb 2010, at 20:01, email@hidden wrote:

Send Automator-users mailing list submissions to
email@hidden

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.apple.com/mailman/listinfo/automator-users
or, via email, send a message with subject or body 'help' to
email@hidden

You can reach the person managing the list at
email@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Automator-users digest..."


Today's Topics:

  1. Using Automator to assert Finder preferences? (Chris Devers)


----------------------------------------------------------------------

Message: 1
Date: Thu, 4 Feb 2010 13:56:58 -0500
From: Chris Devers <email@hidden>
Subject: Using Automator to assert Finder preferences?
To: email@hidden
Message-ID:
<email@hidden>
Content-Type: text/plain; charset=ISO-8859-1

I've looked through the archives, but don't see anything along these
lines. If this is FAQ material or has already been discussed
elsewhere, please let me know.

I'm trying to come up with an automated way to make two changes to user's Macs:

* turn off icon previews for the Desktop and all 4 Finder display views
* add mounted network drives to the Finder sidebar, the way Tiger & Panther did

Both of these are, of course, simple to do from the GUI. For the
former, just hit cmd+J to bring up view options, then uncheck the
boxes as needed; for the latter, just drag the drive icons to the
sidebar.

The problem is that I'm having trouble coming up with a good automated
way to do this for masses of computers. I could just distribute a
common .plist file for people, but I don't want to clobber any of
their other settings, just these two, so that's overkill.

For other things, I can use a `defaults write ...` command to change
the option, but because of the way these are both set within nested
data structures in the .plist file, the syntax for that starts getting
complicated and, worse, brittle. I could also use PlistBuddy, which is
a bit more adept at handling complex .plist structures, but it still
seems like a pain for this problem.

Then I realized that Automator can record me making these changes, and
save the result as a runnable application that appears to work, at
least for the icon previews problem -- haven't tried it for the
volumes-in-sidebar one yet.

The downside though is that every time you run it, it just toggles the
state from whatever it was last set to, rather than affirmatively
asserting that the box needs to be unchecked only if it was previously
checked, and I can't seem to figure out how to insert that kind of
logic into the Automator workflow. (Maybe I could call a shell script
that does a diff on "before" and "after" versions of the .plist, and
reverts back to the original if it was already set properly?)

I also tried AppleScript Editor, but this doesn't even record the UI
actions in enough detail, just "open Finder, open window, close
window". No help there.

So, The Question:

What is the usual method, if any, for using Automator (or AppleScript)
to change a preference file setting if & only if it wasn't already the
way you need it to be set?

Thank you.


--
Chris Devers


------------------------------

_______________________________________________
Automator-users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/automator-users


End of Automator-users Digest, Vol 49, Issue 1
**********************************************

Thanks

Richard Lake
Marketing Manager




 

Tel: 0800 158 3898 | Fax: 01472 251 600 | Email: email@hidden

Address: Unit 12a, Estate Road 8, Grimsby, Lincolnshire, DN31 2TG



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Reply to Answer to Mounted Network Drives
      • From: Chris Devers <email@hidden>
  • Prev by Date: Using Automator to assert Finder preferences?
  • Next by Date: Re: Reply to Answer to Mounted Network Drives
  • Previous by thread: Using Automator to assert Finder preferences?
  • Next by thread: Re: Reply to Answer to Mounted Network Drives
  • Index(es):
    • Date
    • Thread