Jump to content

Script only works when database is at front....


This topic is 7768 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi.... I would be grateful if anyone could help me with my problem....

I made a script using FileMaker's ScriptMaker. In ScriptMaker,

I used "perform applescript" and this script is called "UserIDFolder".

It resides in the Users.fp5 database. The applescript creates

a folder on my computer when a new User record is created and the

folder is automatically named with the UserID on that particular record.

The online form that I use to create a new User record in the Users.fp5 database looks like this:

<form action="FMPro" method="post" name="newuserform">

<input type="hidden" name="-DB" value="Users.fp5">

<input type="hidden" name="-LAY" value="cgi">

<input type="hidden" name="-FORMAT" value="login.html">

<input type="hidden" name="-Script" value="UserIDFolder">

.....several fields properly named with spaces to have

the user input data......

<input type="submit" name="-new" value="Submit">

My records always get created when I submit the online form. So, my form does work.

If the Users.fp5 database is at the front of FileMaker when I submit

my online form then everything works great! The new record is created

and so is the folder (named with the UserID).

But for some strange reason, my applescript only works (i.e. creates

the folder) when the Users.fp5 database is at the front of FileMaker

when I press the online submit button.

If the Users.fp5 database is not at the front then only the record

gets created and my applescript doesn't work.

My applescript creates a folder for every single User record created

and each folder is appropriately named with the UserID (from the

UserID field). When each new folder is created, the applescript

also copies a file called ".upload" into the folder.

My Applescript is like this:

---

tell application "FileMaker Pro"

set FolderName to cell "UserID"

end tell

tell application "Finder"

make new folder at folder "MacHD laugh.gif" border="0atabases:FileMaker Applications:FileMaker

Pro 5:Web laugh.gif" border="0C:images" with properties {name:FolderName}

copy item ".upload" of folder "MacHD laugh.gif" border="0atabases:FileMaker Applications:FileMaker

Pro 5:Web laugh.gif" border="0C:upload" to folder ("MacHD laugh.gif" border="0atabases:FileMaker Applications:FileMaker

Pro 5:Web laugh.gif" border="0C:images:" & FolderName)

end tell

---

I'd really appreciate some help. Do you have any idea what the problem could be?

Link to comment
Share on other sites

This topic is 7768 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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