Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Path name to variable

 
   Database Help (Home) -> FileMaker RSS
Next:  Forms and multiple tables or queries  
Author Message
Aladino

External


Since: Feb 01, 2008
Posts: 10



(Msg. 1) Posted: Fri Oct 03, 2008 10:28 am
Post subject: Path name to variable
Archived from groups: comp>databases>filemaker (more info?)

With Filemaker 8.5 (I work with developer 9 but script should work with
Pro 8.5), is there a way to puth a file path in a variable?
I need it to make a import script, that imports multi-table files that I
can't now the path before, and I won't have 4 open file dialogs each
import (one for table)...
I saw that putting an example filepath in a variable, and using the
variable as import path, works fine, but now I want to select the file
with an open file dialog and get the path to put in the variable.

--
Per rispondere, togliere -NOSPAM- dall'indirizzo.

 >> Stay informed about: Path name to variable 
Back to top
Login to vote
Aladino

External


Since: Feb 01, 2008
Posts: 10



(Msg. 2) Posted: Fri Oct 03, 2008 1:25 pm
Post subject: Re: Path name to variable [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Aladino <borgobello-NO DeleteThis @SPAM-alice.it> wrote:

> With Filemaker 8.5 (I work with developer 9 but script should work with
> Pro 8.5), is there a way to puth a file path in a variable?
> I need it to make a import script, that imports multi-table files that I
> can't now the path before, and I won't have 4 open file dialogs each
> import (one for table)...
> I saw that putting an example filepath in a variable, and using the
> variable as import path, works fine, but now I want to select the file
> with an open file dialog and get the path to put in the variable.
P.S. I'm on Mac, so it can be done using AppleScript, but until now I
can't find the way...

--
Per rispondere, togliere -NOSPAM- dall'indirizzo.

 >> Stay informed about: Path name to variable 
Back to top
Login to vote
Aladino

External


Since: Feb 01, 2008
Posts: 10



(Msg. 3) Posted: Fri Oct 03, 2008 5:25 pm
Post subject: Re: Path name to variable [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Aladino <borgobello-NO.TakeThisOut@SPAM-alice.it> wrote:

> until now I can't find the way...
I found the way (without AppleScript or plug-ins Wink

--
Per rispondere, togliere -NOSPAM- dall'indirizzo.
 >> Stay informed about: Path name to variable 
Back to top
Login to vote
Lou Lesko2

External


Since: Oct 07, 2003
Posts: 48



(Msg. 4) Posted: Fri Oct 03, 2008 5:25 pm
Post subject: Re: Path name to variable [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

* Aladino <borgobello-NO.RemoveThis@SPAM-alice.it>:
> Aladino <borgobello-NO.RemoveThis@SPAM-alice.it> wrote:
>
>> until now I can't find the way...
> I found the way (without AppleScript or plug-ins Wink
>
Share the details, that's the idea behind a newsgroup.

Lou
 >> Stay informed about: Path name to variable 
Back to top
Login to vote
Aladino

External


Since: Feb 01, 2008
Posts: 10



(Msg. 5) Posted: Sat Oct 04, 2008 5:25 am
Post subject: Re: Path name to variable [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Lou Lesko <loulesko DeleteThis @yahoo.com> wrote:

> Share the details, that's the idea behind a newsgroup.
OK. It seemed me there was no interest about the thing...
Even it's not the perfect way, I did so:
I made a calculation field in the first table of the file to import
(I'll call it 'origin'), with no memorized path of the file (calculated
as needed). This should really be done before to all files that can have
the need to be imported somewhere (now I will do it, even I don't know
if I will use it).
After that, in the new file, I made a script with a first import of the
path from the origin file to a global field; then I assigned the path to
a variable, and used this variable as path to import all tables from the
origin (one import step for each tabale). So, if the origin has the
field I called 'fileptah' I must select only one time the origin,
otherwise, I'll be asked to select it for any table my script want's to
import.
Not clear? OK, here's the script:

Freeze Window
Beep
Beep
Beep
Show Custom Dialog [ Title: "ATTENZIONE:"; Message: "L'importazione
eliminerà tutti i dati attualmente presenti nel ï¬le, si è
sicuri di voler procedere?"; Buttons: "Annulla", "Procedi" ]
Enter Browse Mode
If [ Get ( LastMessageChoice ) = 2 ]
# Path Import
Set Variable [ $vecchioï¬le; Value:"dati da importare" ]
Import Records [ Source: "$vecchioï¬le"; Target: "PraticaEdile";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
Source ï¬eld 124 import to PraticaEdile::import_path ]
[ No dialog ]
If [ PraticaEdile::import_path = "" ]
Beep
Show Custom Dialog [ Title: "Importazione vecchi Modul-EDI";
Message: "Il ï¬le indicato è di una versione precedente
alla 2.6, e non è possibile stabilirne la versione e la posizione
per tutte le operazioni necessarie; pertanto sarà
necessario selezionarlo più volte per il completamento
dell'importazione. E' comunque sconsigliato l'importazione di
dati da versioni precedenti alla 2.5"; Buttons: "OK", "Annulla" ]
If [ Get ( LastMessageChoice ) = 2 ]
Exit Script [ ]
End If
Else
Set Variable [ $vecchioï¬le; Value:PraticaEdile::import_path ]
End If
# File Reset
Go to Layout [ "Tecnici e imprese" (Tecnici e imprese) ]
Show All Records
Delete All Records [ No dialog ]
Go to Layout [ "Elenco Asseverazioni" (Asseverazione) ]
Show All Records
Delete All Records [ No dialog ]
Go to Layout [ "Elenco Domande" (Domanda univoca) ]
Show All Records
Delete All Records [ No dialog ]
Go to Layout [ "Scheda Privato" (PraticaEdile) ]
Show All Records
Delete All Records [ No dialog ]
# Data Import
Import Records [ Source: "$vecchioï¬le"; Target: "PraticaEdile";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
\cut
[ No dialog ]
Go to Layout [ "Elenco Domande" (Domanda univoca) ]
Import Records [ Source: "$vecchioï¬le"; Target: "Domanda univoca";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
\cut
[ No dialog ]
Go to Layout [ "Elenco Asseverazioni" (Asseverazione) ]
Import Records [ Source: "$vecchioï¬le"; Target: "Asseverazione";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
\cut
[ No dialog ]
Go to Layout [ "Tecnici e imprese" (Tecnici e imprese) ]
Import Records [ Source: "$vecchioï¬le"; Target: "Tecnici e imprese";
Method: Add; Character Set: "Mac Roman"; Field
Mapping:
\cut
[ No dialog ]
Go to Layout [ "Scheda Privato" (PraticaEdile) ]
End If
Refresh Window

I repeat, it's not perfect way, so If someone has a better one (to
import multiple table of 'before unknown path files') I'm happy to here
this other methods.
P.S. excuse me for me no perfect english Smile--
Per rispondere, togliere -NOSPAM- dall'indirizzo.
 >> Stay informed about: Path name to variable 
Back to top
Login to vote
Chris Brown

External


Since: Jun 23, 2003
Posts: 87



(Msg. 6) Posted: Mon Oct 06, 2008 7:26 pm
Post subject: Re: Path name to variable [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Aladino wrote:
> With Filemaker 8.5 (I work with developer 9 but script should work with
> Pro 8.5), is there a way to puth a file path in a variable?
> I need it to make a import script, that imports multi-table files that I
> can't now the path before, and I won't have 4 open file dialogs each
> import (one for table)...
> I saw that putting an example filepath in a variable, and using the
> variable as import path, works fine, but now I want to select the file
> with an open file dialog and get the path to put in the variable.
>


I do quite a bit of scripted import/export; this is extract of what I
use on FM9Av3 on Mac OSX.5.5


Set Error Capture [ On ]
#
Set Variable [ $_PATH; Value:Let([
FP = Get ( FilePath ) ;
FN = Get ( FileName ) ;
FPstub = Substitute( FP ; FN & ".fp7"; "" ) ;
TO = "export/"
];
FPstub & TO
) ]
#
#

#==================================================
Go to Layout [ "Patients" (Patients) ]
Set Variable [ $_imp; Value:$_PATH & Get ( LayoutTableName ) ]
Import Records [ Source: "$_imp"; Target: "Patients"; Method: Add;
Character Set: "Mac Roman"; Field Mapping: Source ï¬eld 1
import to Patients::NameLast
Source ï¬eld 2 import to Patients::NameFirst

[ No dialog ]
#
#capture the PatID - use to update dependents
Set Variable [ $_Pat; Value:Patients::Pat_ID ]
#
#==================================================


The initial path can be calculated from the location of the parent file
(the one being imported into). In this case the target file is in a sub
directory: /export. (20 or so exported tables (i.e. files have been
created in this holding/transfer directory)


The initial calc variable sets the path stub.
The exports files adopt the origin table name.
stepping through the layouts and show all/delete all is required (as
your later post) in this particular situation.
The serial number ID for each table is reset


One thing that will make it considerably more involved is where there
are multiple table dependencies parent/child/grand child...
and the parent ID is captured to variable, loop sub-routines encode the
NEW parent ID at import... hence the
#capture the PatID - use to update dependents
indication.


Note that if you clone the file with the import script, mapping will be
'lost' . This is another discussion unto itself, but if you clone,
RECHECK the mappings.
 >> Stay informed about: Path name to variable 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> FileMaker All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]