Jump to content
Sign in to follow this  
Rob Reynolds

Build applescript based on global fields?

Recommended Posts

I am trying to build an applescript within FM that will mount a network share based on the contents of global fields that contain the ip of the remote machine, the share point, the user name, and the password. The applescript script itself is contained in another global field that is calculated at run time to combine the other fields with static text to get it into the proper applescript form. I then tell the FM applescript step to use that global field for the applescript. It ends up looking something like this:

property AFPdisk : "afp://192.168.123.110/thesharepoint"

property AFPuser : "theusername"

property AFPpswd : "thepassword"

try

mount volume AFPdisk as user name AFPuser with password AFPpswd

end try

When I run the applescript, I get this error message: "An unknown token can't go after this some object (Error -2740)" I tried doing it as above (with properties) and also by simply integrating my FM globals directly into the "mount" statement. It did not work either way.

If I copy the global field that contains the built script into the "script text" area of a FM applescript step and run that FM script, the applescript works (the share point mounts).

Anyone know what the problem might be? I'll be the first to admit I'm an applescript newbie -- if anyone has suggestions on how I might better achieve these results, please let me know.

Some other questions that came up with this:

-- I have to include the applescript globals/variables in quotes. Is there some way to include quotes in an FM script and have them not interpreted as marking off static text? As it now stands, I used a global that contains just a double quote, and I put that global before and after variables that need to be enclosed in quotes. FYI, I'm doing it this way because I'd rather be able to just put the required variables in the global fields, without having to remember to enclose them in quotes.

Thanks for any help!

Rob confused.gif

Share this post


Link to post
Share on other sites

After scratching my head for a day and playing around some more with this, I *was* able to get it to work. It prolly would have helped if I had included an error capture routine in the applescript -- I'll have to study up on that one... It turns out I was specifying an incorrect IP number, to a machine that would not accept a connection. When I changed the IP to the correct machine, it worked like a charm!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.