• 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: Capturing username for script that mounts server
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Capturing username for script that mounts server


  • Subject: Re: Capturing username for script that mounts server
  • From: kai <email@hidden>
  • Date: Wed, 30 Mar 2005 22:12:09 +0100


On Wed, 30 Mar 2005 10:00:42 -0500, Ed Wiederer wrote:

I've got a script that I am using as a folder action that takes files saved to the folder and copies them to specific places on different servers. I've managed to cobble something together that will also mount the servers if they aren't already there. The scripting may be a little rough (I am new to this and I'm just adapting bits and pieces wherever I find them), but it's working like a charm on my machine, where the script has my username written into it.

The trick is, I want to distribute this to my coworkers and I want to make it as easy as possible -- i.e. no need for them to open Script Editor and type in their user name. So I'm trying to come up with something that will pop up a dialog box that will capture their user name. But I only want that box to come up the very first time they run the script, and have the script retain that information from there on out.

Below is roughly what I have done, but this pops up the dialog box every time the script is run, even when the servers are mounted. I imagine I could move the set myUser line down to the if thelist does not contain lines, though that would make me repeat it for each server. In any case, it doesn't solve the bigger problem I'm having, which is getting the script to retain that user name so you only get the dialog box the very first time you run it.

(* snip *)

property myUser : ""
on adding folder items to this_folder after receiving these_items
    tell application "Finder"
        if myUser is "" then
            set myUser to text returned of (display dialog "Enter your user name" default answer myUser)
        end if

(* snip *)

     end tell
end adding folder items to

When I first glanced at your script, Ed, I couldn't really see why it should fail. I then tested the above part of it, which worked fine - with the dialog coming up only the first time I added an item to the relevant folder. I assume that the script isn't being opened and recompiled in Script Editor (which would reset the property 'myUser' to an empty string again), so I can't replicate the problem here. There must be something else going on...


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


  • Prev by Date: Photoshop CS Help ; |
  • Next by Date: Re: Capturing username for script that mounts server
  • Previous by thread: Re: Capturing username for script that mounts server
  • Next by thread: Re: Capturing username for script that mounts server
  • Index(es):
    • Date
    • Thread