dbTalk Databases Forums  

button to open text file

comp.databases.filemaker comp.databases.filemaker


Discuss button to open text file in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
r_poetic
 
Posts: n/a

Default button to open text file - 07-02-2009 , 02:38 PM






This seems like an old question, but anyway. This database has some
supplemental info in text form that I would like to be able to view at
random times, so I added a button that executes a script to open a
separate text file. However, the step, Open URL["Macintosh HD: Users:
myplace: List.txt"] goes looking for a web site. How can it be told
to open the local file instead? (And would the answer to that
question be the same if I moved the db to a Windows machine).

Reply With Quote
  #2  
Old   
Chris Brown
 
Posts: n/a

Default Re: button to open text file - 07-02-2009 , 09:26 PM






r_poetic wrote:
Quote:
This seems like an old question, but anyway. This database has some
supplemental info in text form that I would like to be able to view at
random times, so I added a button that executes a script to open a
separate text file. However, the step, Open URL["Macintosh HD: Users:
myplace: List.txt"] goes looking for a web site. How can it be told
to open the local file instead? (And would the answer to that
question be the same if I moved the db to a Windows machine).

there are variations depending on where the file is (local or server),
where it is relative to te dtabase file... but this works on mac and
win, for a directory on the desktop
Depending on where the file is, you can use Get(desktop), etc. or hard
code.
It can be shortened of course, but I usually use the initial variables
to progressively check the path assembly and transportability




SHOW: show_help_pdf
#1/7/09
#open help files in pdf format
#
#parse the file name from the script parameter: no spaces or special
characters. filename format help_abc.pdf
Set Variable [ $_filename; Value:getSP_n ( 1 ) ]
#
#help directory filepath: hard coded
Set Variable [ $_helppath; Value:Get ( DesktopPath ) & "ed_help/" ]
#filepath
Set Variable [ $_PATH; Value:$_helppath & $_filename ]
#
#1 if the current platform is Intel-based Macs -2 if the platform
is Windows XP or Windows Vista
Set Variable [ $_platform; Value:Get ( SystemPlatform ) ]
#
#
#
#OPEN ORIGINAL
If [ $_PLATFORM = 1 ]
#mac intel
#specify: Preview
Send Event [ open document; File Name: “filemac:$_PATH”; Application
Name: “Preview.app” ]
[ Wait for completion; Bring application to foreground ]
#
#
Else If [ $_PLATFORM = "-2" ]
#win xp/vista
#path format - /E:/server docs/abs/help_abc.pdf
#specify: Acrobat Reader
Send Event [ open document; File Name: “filewin:$_PATH”; Application
Name: “<unknown>” ]
[ Wait for completion; Bring application to foreground ]
End If

Reply With Quote
  #3  
Old   
Your Name
 
Posts: n/a

Default Re: button to open text file - 07-03-2009 , 02:22 AM



"r_poetic" <radford.schantz (AT) mms (DOT) gov> wrote

Quote:
This seems like an old question, but anyway. This database has some
supplemental info in text form that I would like to be able to view at
random times, so I added a button that executes a script to open a
separate text file. However, the step, Open URL["Macintosh HD: Users:
myplace: List.txt"] goes looking for a web site. How can it be told
to open the local file instead? (And would the answer to that
question be the same if I moved the db to a Windows machine).
I've never had a reason to use the Open URL command with anything other than
a real web address, but a URL address does need to have the correct prefix
so that the web browser to know what to do with it.
e.g.
website http://
email mailto:
ftp site ftp://
local file file://
etc.

When you open a URL address (or type one manually) without a prefix, the web
browser automatically assumes that it is a website and adds "http://" to the
front.

I would need to check on my Mac to see what that does, but opening a local
file in Firefox on this ancient Windows PC gives an address like
file:///D:/MyFile.txt

At the very least you will have to add the prefix, and you may need to do
some manipulation of the address / file path depending on whether the
database is running on a Mac OS or Windows computer.

Helpful Harry )

Reply With Quote
  #4  
Old   
r_poetic
 
Posts: n/a

Default Re: button to open text file - 07-06-2009 , 12:59 PM



On Jul 3, 2:22*am, "Your Name" <your.n... (AT) isp (DOT) com> wrote:
Quote:
"r_poetic" <radford.scha... (AT) mms (DOT) gov> wrote in message

news:ba17f899-1251-45d1-9621-540887cc604b (AT) y9g2000yqg (DOT) googlegroups.com...

This seems like an old question, but anyway. This database has some
supplemental info in text form that I would like to be able to view at
random times, so I added a button that executes a script to open a
separate text file. *However, the step, Open URL["Macintosh HD: Users:
myplace: List.txt"] goes looking for a web site. *How can it be told
to open the local file instead? *(And would the answer to that
question be the same if I moved the db to a Windows machine).

I've never had a reason to use the Open URL command with anything other than
a real web address, but a URL address does need to have the correct prefix
so that the web browser to know what to do with it.
e.g.
* * *website * * *http://
* * *email * * * * mailto:
* * *ftp site * * * ftp://
* * *local file * * file://
* * *etc.

When you open a URL address (or type one manually) without a prefix, the web
browser automatically assumes that it is a website and adds "http://" to the
front.

I would need to check on my Mac to see what that does, but opening a local
file in Firefox on this ancient Windows PC gives an address like
file:///D:/MyFile.txt

At the very least you will have to add the prefix, and you may need to do
some manipulation of the address / file path depending on whether the
database is running on a Mac OS or Windows computer.

Helpful Harry *)
Thanks, the file:// and / instead of : works!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.