Jump to content

Opening Remote Database with AppleScripts


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

Recommended Posts

Can anybody please shed some light on this one.

I'm trying to use Applescript to open a remote database on a certain day each week and automatically run a report. I am wording the Applescript to the format as per Filemakers Applescript dictionary, but the database is not actually opening. It is opening the remote access window and showing all the databases available but not actually opening the requested database.

My script is as follows:

tell application "Finder"

if weekday is Thursday then

tell application "FileMaker Pro"

activate

get remote URL "FMP5://[url address]/database.fp5"

end tell

else

display dialog "This script should only be run on Thursdays"

end if

end tell

Link to comment
Share on other sites

>get remote URL "FMP5://[url address]/database.fp5"

You are putting the actual name of the database in here I presume as in "contacts.fp5" or the like?

But that syntax is not correct to open the file. Try this one instead:

getURL "fmp5@[email protected]/contacts.fp5"

substitute your password for password

substitute your URL for 12.34.56.78

substitute the name of your database for contacts.fp5

HTH

Old Advance Man

Link to comment
Share on other sites

I have the password thing sorted now. Next thing is more of a general Applescript query. I am trying to get the script to run the report only on a Thursday. My initial trial of the line:

if weekday is Thursday then

tell Filemaker..............

end if

This does not work!

How do I word the Applescript command to get the script to run only on a Thursday?

[ December 06, 2001: Message edited by: mad_mickey ]

Link to comment
Share on other sites

I don't think there is any weekday function in Applescript, but you can calculate it as follows:

-- This will produce a number in the range 0..6 with Sunday=0

set dayofweek to ((current date - "December 31, 2000") mod 7)

-- and Thursday is 4

if dayofweek is 4 then

tell Filemaker..............

end

[ December 06, 2001: Message edited by: BobWeaver ]

Link to comment
Share on other sites

This topic is 8169 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.