Our Preferred Hosting Provider - Award Wining FileMaker Pro Hosting
Results 1 to 10 of 10
  1. #1
    Senior Moderator - FMT Preferred Developer Consultant Arizona, NM, Texas, Southwest USA
    Join Date
    Mar 2006
    Posts
    2,700
    Location
    So. Arizona
    FileMaker Version
    FM 9 Developer, FM 10 Server, FM 11 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.8.5

    Question Cross-Platform Open File slash format questions??

    Using the BaseElements plugin, I am attaching file names/paths to records for job documentation (and parsing out the filename for display and obfuscation of the path info).

    The path is stored based on the file location. A BE_OpenFile (path) command uses the stored file path (generated from BE_SelectFile) to open the file at the OS level, outside of FM.

    The issue (may?) come from the fact that this is a mixed Mac/PC shop. The stored files are all on a Windows server, but many (most?) of the files, are things like PDF files, that can be opened on either platform.
    The path is stored as a windows structure, with backslashes. ALL other platforms use the standard front slash convention, including the Mac.

    Do I need to run a substitute on the slash - backslash issue based on the Get (SystemPlatform) result? Or is there a better way to tackle this?

  2. #2
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,374
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9 Developer, FM 9 Server, FM 10 Developer, FM 10 Server, FM 11 Server, FM 12 Developer, FM 12 Server, Older Versions 2-8
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.6.8
    Doesn't matter where the files are stored, but if you're using native FileMaker commands to open files (whether on a Mac or a PC client) you need forward slashes to represent folders, not backslashes; if you're using the plug-in itself to open files, I have no idea, as it could use its own nomenclature.

  3. #3
    Senior Moderator - FMT Preferred Developer Consultant Arizona, NM, Texas, Southwest USA
    Join Date
    Mar 2006
    Posts
    2,700
    Location
    So. Arizona
    FileMaker Version
    FM 9 Developer, FM 10 Server, FM 11 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.8.5
    "Native Filemaker Commands" - what FM command(s), allows a user to interactively select, using a file OPEN dialog (or some facsimile thereof), a non-FM file? THAT would be great!

    Scenario: A given job may have CAD files (Solidworks), PDF, Word doc, scanned image, text file of a copied email, fax (.tif), etc., attached. The only was I could figure out (based on a post here), was to use something like BaseElements plugin, to get file system interactive access. Is there a way for FM to allow a user to selectively grab a file from a directory - or ideally, just a file reference? Then is there a command in FM that allows a user to select the file reference, and open that file in whatever the non-FM default application is?

    I used BaseElements, BE_SelectFile (which opens an OS FILE OPEN dialog) and BE_Open_File (which takes the stored path, and executes the file with the default application for that file type) to perform these functions.

    If there is a native FM way, I'd be thrilled to switch.

    If not, the original question is in regards to the forward/backward slash compatibility on stored paths in a cross-platform client environment - which may be a non-issue; just thought someone might know.

    Maybe I just need to fire up a PC VM, and test it under Windows. Just wish that FM's latest license checker worked like it used to, and allowed both Windows and Mac licenses to run on the same physical hardware / different VMs simultaneously. It is a pain to have to shut one down to test the other, and I don't really want to set up a separate Windows box unless I really have to.

  4. #4
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,374
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9 Developer, FM 9 Server, FM 10 Developer, FM 10 Server, FM 11 Server, FM 12 Developer, FM 12 Server, Older Versions 2-8
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.6.8
    what FM command(s), allows a user to interactively select, using a file OPEN dialog (or some facsimile thereof), a non-FM file? THAT would be great!


    Set Variable [$FilePath; "file:///Users/AHunter3/Documents/Example.xlsx"]
    Open URL [no dialog, $FilePath]


    1) forward slashes, without "filemac" or "filewin", just "file://"

    2) it's a classic Unix URL type. For MacOS that means for any volume other than the startup volume you need to include "/Volumes/VolumeName/" not just "VolumeName/" -- e.g.,

    "file:///Volumes/Disk2/Stuff/Example.txt"

    ... whereas if it IS on the startup volume, just / followed by the folder name, no "Macintosh HD" (or equivalent); omit the volume name for the startup disk, in other words. "file://" followed by "/" to indicate root volume results in three consecutive slashes, as per example above. First two are the standard protocol "file://" indicator, third one means root volume. Since "Volumes" is treated in Unix as if it were a folder on the startup HD, there are always three slashes in file URLs on a Mac.

    For windows, classic lettered drives supported for sure, and I think also works with those double-slash netpaths, but again they must be rendered as forward-slashes as if it were a Unix box. Two slashes, or possibly four for netpaths, on Windows, instead of the 3 for Mac.

    Trial and error will get you there.
    Last edited by AHunter3; 10-02-2013 at 10:51 AM.

  5. #5
    Senior Moderator - FMT Preferred Developer Consultant Arizona, NM, Texas, Southwest USA
    Join Date
    Mar 2006
    Posts
    2,700
    Location
    So. Arizona
    FileMaker Version
    FM 9 Developer, FM 10 Server, FM 11 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.8.5
    The user that is connecting the document to the job, would be best served by NOT having to type in the entire path, but just select the file from a dialog. Is there a way to accomplish this?

    I'd like to pass the filename into FM from a user selection dialog, not a long type-it-in-manually approach.

    Also - related - is there a way to programmatically pass a file into a container field? I don't see a way for Cut & Paste to allow the content to be "by reference" (which provides an easy-to-use user selection and attachment process).
    In the script approach, where that option exists, I have not figured out how to allow the "ADD FILES" function to be exposed to a user for point & click dialog selection of the file to place in the container.

  6. #6
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,374
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9 Developer, FM 9 Server, FM 10 Developer, FM 10 Server, FM 11 Server, FM 12 Developer, FM 12 Server, Older Versions 2-8
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.6.8
    The user that is connecting the document to the job, would be best served by NOT having to type in the entire path, but just select the file from a dialog. Is there a way to accomplish this?
    Well, easily enough if you create a FileList table containing at least two fields, FileName and FilePath. Make valuelist of FilePath also showing values from FileName, sort by second value, only show second value. Won't work if you folks have "FileName.xls" in two different locations, of course.

    Also - related - is there a way to programmatically pass a file into a container field?
    Absolutely. Plain ol' Set Field:


    Set Field [YourTable::ContainerField; "filemac://Macintosh HD/Users/AHunter3/Documents/Example.xlsx"]

    that stores a reference. If you want/need the file ITSELF to be inserted into container field you need to use Insert File instead of Set Field.

  7. #7
    Senior Moderator - FMT Preferred Developer Consultant Arizona, NM, Texas, Southwest USA
    Join Date
    Mar 2006
    Posts
    2,700
    Location
    So. Arizona
    FileMaker Version
    FM 9 Developer, FM 10 Server, FM 11 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.8.5
    Quote Originally Posted by AHunter3 View Post
    Well, easily enough if you create a FileList table containing at least two fields, FileName and FilePath. Make valuelist of FilePath also showing values from FileName, sort by second value, only show second value. Won't work if you folks have "FileName.xls" in two different locations, of course.
    OK, so how do you populate this "pick list" from thousands of existing files in dozens or even hundreds of directories, segregated into a directory structure?

    Quote Originally Posted by AHunter3 View Post
    Absolutely. Plain ol' Set Field:
    Set Field [YourTable::ContainerField; "filemac://Macintosh HD/Users/AHunter3/Documents/Example.xlsx"]

    that stores a reference. If you want/need the file ITSELF to be inserted into container field you need to use Insert File instead of Set Field.
    But my question is how to programmatically GET the filename - to allow a user to pick a file from a list.

    There are hundreds (thousands?) of files stored in directories today on the server. They want to allocate those to jobs - at least in the future - so that every document of any type, associated with a job, is linked to the job in the FM job control system.
    How do I get the "filemac://Macintosh HD/Users/AHunter3/Documents/Example.xlsx" string so it can be passed to the SET FIELD command, without typing a single character - just point and click - using FM commands?

  8. #8
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,374
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9 Developer, FM 9 Server, FM 10 Developer, FM 10 Server, FM 11 Server, FM 12 Developer, FM 12 Server, Older Versions 2-8
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.6.8
    First task is to enable the user to pick the file from what I gather is a pretty long list. Too long to just have a single-throw value list (thousands of values).

    Method A: g.StartingLetter wtih dropdown VL of 26 letters plus numerals 0-9 and maybe something representing "anything else" such as files starting wtih _ or . or whatever

    ... then a second value list showing related values only by calculated firstcharacter. Now you have a value list of hundreds instead of thousands of values. Still perhaps too cumbersome. Probably is. So maybe you have them select a category and then a starting letter and thereby narrow the resulting third VL to, I dunno, 92-someodd possible files?


    Or perhaps they can select from foldername then subfoldername and thus drill down much as you would on a computer, double-clicking your way through a filesystem hierarchy? That would depend on them knowing where the file IS (even if they aren't compelled to type in the file path).

    Or perhaps first select the file EXTENSION (i.e., file type), so that all Word docs or all Excel docs pop down instead of all documents altogether.


    You get the idea. You need to narrow it down to a manageable valuelist size.


    Then with the resulting non-cumbersome final value list the user picks "Example.xlsx" and what actually fills in the "fetchme" field is the associated full file path. Then you execute Open URL on that filepath string.

  9. #9
    Senior Moderator - FMT Preferred Developer Consultant Arizona, NM, Texas, Southwest USA
    Join Date
    Mar 2006
    Posts
    2,700
    Location
    So. Arizona
    FileMaker Version
    FM 9 Developer, FM 10 Server, FM 11 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.8.5
    One saving grace: the client has maintained 1) a pretty consistent directory structure, matching job records, and 2) a file naming convention that is probably done correctly, 80% of the time.

    Always try to stay away from plugIn, but in this case, I think I may stick with the BaseElements plugIn, as it has the BE_SelectFile function, that calls the OS Open File system dialog, and returns the file path after selection. I can then parse out the file name for display, and store the path as well.

    Be_SelectFile (brings up the OS File Open dialog)
    BE_ListFilesInFolder (Pulls the list - I could use this to populate a file picker in FM! Defeats the purpose of attempting to avoid the plug in :-( )
    BE_FileExists (Test for the existence of the file on that path)
    BE_OpenFile (like double clicking the container content, this launches the file as shown in the stored path).

    ....... and a bunch of other nice commands as well.......

    On parsing out the filename (counting the number of "/" to use in a position command, to get the last one before MIDDLEing out the file name), do I have to be concerned with "/" vs. "\" ???
    Maybe use a patterncount to determine which slash is in the filepath string.

  10. #10
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,374
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9 Developer, FM 9 Server, FM 10 Developer, FM 10 Server, FM 11 Server, FM 12 Developer, FM 12 Server, Older Versions 2-8
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Mac OS X 10.6.8
    I'd middle out the string returned by Substitute ($OriginalString; "\\"; "/") and then they've been normalized.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cross platform V9
    By Databasic in forum FileMaker Runtimes
    Replies: 2
    Last Post: 05-01-2008, 04:15 PM
  2. some cross platform problems
    By rocklobster in forum FileMaker Pro 8.5
    Replies: 2
    Last Post: 04-23-2008, 07:46 AM
  3. cross-platform hassles
    By Maarten Witberg in forum Operating System Issues
    Replies: 0
    Last Post: 08-10-2005, 01:22 PM
  4. Cross-Platform file sharing?
    By VFXbeth in forum FileMaker Pro Server and Networking
    Replies: 2
    Last Post: 05-03-2005, 01:08 PM
  5. Cross Platform Graphics
    By RobR in forum Older Versions of FileMaker Pro
    Replies: 7
    Last Post: 03-01-2002, 11:03 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Welcome to the Original FileMaker Forum
With designated forums for almost every FileMaker topic...FileMaker Today is a free-to-join community where you can boost your FileMaker expertise, build better solutions and solve your technical challenges. If you're building FileMaker solutions, this is the place for you.
Follow FMT
We Are FMT
FMT is home of The World's leading FileMaker News Site, Worldwide Developer Directory, FileMaker Connect Community and so much more.