Jump to content

External script without asking for password


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

Recommended Posts

Hi guys - belated happy new year!!

I need Filemaker to do one simple thing that has been driving me nuts for weeks. I thought I'd found the answer buy nay!!

After hours searching on the net I found a program called iDo Script Scheduler to execute an APPLESCRIPT at a certain time

the script I am executing is called RUN REPORTS DATABASE which looks like this

tell application "Finder"

activate

select file "auto reports.fp5"

open selection

end tell

the file "auto reports.fp5" is an empty database with a script that runs upon openng of the database which looks like

perform <external script> sales database ; print sales report

exit application

the iDo Script Scheduler runs this script every day at 20:00 hours.

The external script of 'sales database' updates a unique number that corresponds to a days activity between 8pm and 8pm the next day. Field 'day number' is incremented by +1 every time the script is run and it searches for all record entries that have the previous 'day number' meaning I am not stuck looking for a date and time. Instead it finds a number that is looked up for every new record which only increments at 8pm the following day. (Good search criteria if a day is not seperated by midnight!)

My problem is this:-

The database that is opened by the Applescript does not have a password for obvious reasons - automation would be useless if you are still required to go to the machine to enter a bloody password!

It triggers an external script in a database that DOES have a password - hence, needless to say, I still have the same problem!!!

Is there an addition that I can add to my applescript to paste in the password? Because this script will terminate after the report is done, there isn't any reason to keep it a secret on only one machine that is locked in a high security office. The sales database is controlled by Filemaker Server and this database will only be on an Administrator's CPU and the iDo Script Scheduler will also only be on this one machine.

Failing any answer to this question, please give me an alternative method of making the sales database have an alarm clock to activate the script that increments this lookup field and print routine!

I'm going nuts!!! Please help me!!! I've also pasted this in the Security section of the FM Forums to double up the chances of an answer!

Thank you in advance!!

Link to comment
Share on other sites

quote:

tell application "FileMaker Pro"

open file "my_file" with password "my_pawword"

end tell

when I run this script from the script editor it says

Filemaker Pro got an error: the event failed (open file..... highlighted)

I've tried changing it to

open file "auto reports.fp5" same result

open "auto reports.fp5" same result

open "auto reports.fp5" with password "xxxxxx" same result

open "auto reports.fp5" with password "xxxxxx"

activate same result

can't seem to get it to work!!

:

thanks

Link to comment
Share on other sites

You need the full path to the file. Perhaps your DTDB is in need of rebuilding.

Run this script and copy the result from the results window intpo the other script:

tell application "Finder"

set myfile to choose file

end tell

-->yield something like alias MyCPU laugh.gif" border="0 esktopFolder:mydatabase

then substitute in the other script that for the name of the FMP file

Link to comment
Share on other sites

Since everything in the office of the machine is in a highly secured environment and anyone who shouldn't be there is not, how about keeping the database open on that computer and have Applescript execute the appropriate scripts at the given time? I've been thinking about doing the same thing, just haven't had the time to get that part of it working yet. I hope this helps.

Link to comment
Share on other sites

> the script I am executing is called RUN REPORTS DATABASE which looks like >this

> tell application "Finder"

> activate

> select file "auto reports.fp5"

> open selection

> end tell

And that's why you're having trouble. Wrong syntax. Try this instead:

tell application "FileMaker Pro"

open file "auto reports.fp5" with password "my_password"

end tell

Then the file will open, and if the password is also in the other file, it will open as well to run the script. You could also use the OpenURL ScriptMaker event, because it too can use a password parameter.

The security implications of this are obvious. But that's they way it can be done.

Old Advance Man

Link to comment
Share on other sites

Oh,

I didn't do everything you said straight away - my eyes only saw the bit

with password "dododod"

no silly message this time about the " - just tried it out but of course

the database that has the script doesn't have a password so I've setup the password to be the same as the one with the password I want to get by.

Now it doesn't load the database only the program FILEMAKER with my desktop in the background.

Any ideas?

thanks

Link to comment
Share on other sites

I've tried one more thing:

I put back original applescript:

tell application "Finder"

open file "my_opener.FP5"

end tell

which works a treat!

tell application "Filemaker Pro" doesn't understand the next line and comes up with an error.

I setup the database "my_opener.FP5" with the script that runs on opening of file. No passwords on this. then in the script did the following:-

in there it says:

perform apple script:

* script text

open file "my_file" with password "xxxxx"

and it comes back with the statement

Data is being accessed by another user, script or transaction. (Error -10011)

It doesn't make any difference if I have tell/end tell statements like before, same message comes up.

Any angles on this?

Thanks

[ January 22, 2002: Message edited by: Matt Lightbourn ]

Link to comment
Share on other sites

AppleScript within ScriptMaker does not support opening other FileMaker Pro files. It returns Error -10011.

Originally, you were trying to open the file with an AppleScript triggered by iDO as I recall.

You need to put the same password in the desktop file as is in the one on the server where you want to run the script. Then when the desktop file is opened by the AppleScript, the distant file will open without asking for a password.

Old Advance Man

Link to comment
Share on other sites

Sorry,

I've reverted back to the complete iDo method as discussed - I was just trying out an idea which didn't work.

Back to the blank database with password same as Sales Database

applescript:

tell application "Filemaker Pro"

open file "opening_dbase.FP5" with password "xxxxxx"

end tell

the above script purely loads filemaker. but, from application "Finder" it loads perfectly except for password command.

I tried the 'set and choose script commands but access denied.

I tried above statement without password command and still same problem.

Does Filemaker understand the request of open file - and then with password commands? Is this the problem? It seems to just skip the open file command entirely.

If you just create a blank database with a pass word and try to create a script as mentioned, it just doesn't open it.

Please help, I'm getting depressed deeply!

Thank you!!

Matt

Link to comment
Share on other sites

Matt,

I still believe that the script:

tell application "Filemaker Pro"

activate

open file "filename" with password "password"

end tell

...will work. I think that the problem that you are running into is that you are just typing in the name of the file and not the path. Try typing in place of the filename the entire path to that file. Ex: I have a file that runs locally on my desktop that will launch an external database and both have the same password. In place of the "filename" in the script above, I would replace that with "Macintosh HD laugh.gif" border="0 esktop:Launcher.fp5" This should do the trick for you. The iDo I believe is set for the timing? If so, then just place this script in that and now you'll have a script that will open your databases and run it's internal scripts at the appropriate times.

Give this a try and let me know how it goes

Mun

Link to comment
Share on other sites

Mun

Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude Dude it works!!!!!!!!!

I don't believe it! The one word that was missing was ACTIVATE

THANK YOU VERY MUCH!!!!

Link to comment
Share on other sites

This topic is 8122 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
×
×
  • Create New...

Important Information

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