December 5, 200124 yr 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
December 5, 200124 yr >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
December 5, 200124 yr Remove "remote" from the script and just use "getURL" tell application "FileMaker Pro" activate getURL "FMP5://ip_address_or_dns_name/database.fp5" end tell
December 5, 200124 yr Author Thanks for the help on this one guys. Spragueg's option worked but unfortunately the database is password protected and the "with password string" option doesn't seem to work with the "getURL" script commands! Any ideas?
December 6, 200124 yr Author 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 ]
December 6, 200124 yr 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 ]
December 7, 200124 yr word 1 of date string of (current date) will yield the day of the week of the current date (as per the CPU clock) HTH Old Advance Man
December 7, 200124 yr You can get the three letter weekday(curDay) by using the following applescript... set dateStamp to current date set curDay to weekday of dateStamp [ December 06, 2001: Message edited by: spragueg ]
Create an account or sign in to comment