1 2 Previous Next 16 Replies Latest reply on Jan 5, 2015 6:05 PM by fentonjones

    New MAC user frustrations

    Tom_Droz

      Hi

      I have always been a Filemaker windows users. I market a solution where all my users are also windows user.   I recently have had a couple potential clients that are MAC users, so I figured it was time for me to tweak my solution so that it can work on both systems.

       

      On windows I  install my solution in a few directories which I create with a batch file.

       

      On Mac I haven't even been able to figure out how to create a directory, let alone script it.

       

      I haven't figured out how to install plugins manually

       

      Seems like these should be super simple, but not so far for me.  I know many of you are MAC users, any feedback on how to do these simple things as well as any other gotchas I should be thinking about?  Thanks!

       

      Tom

        • 1. Re: New MAC user frustrations
          beverly

          The Mac has a "package" for many of the things that are not "visibile" without opening the package (right-click or command-click on the .app and see the contextual menu "Show Package Contents". CAUTION just look as changing anything this way can be hazardous!!

           

          I have this directory for the installed FM13 (advanced):

          FileMaker Pro 13 Advanced

              English Extras (templates, documentation, Getting Started)

              Extensions (plug-ins, etc.)

              FileMaker Pro Advanced.app

              FMI Runtime Resources

              FMP Acknowledgements.pdf

              FMP Read Me (English).pdf

              FMPA License (English).pdf

           

          What do you need to install that isn't automatic? Where are you trying to install your "solution"? And yes, there are Mac installer apps that can help.

           

          Beverly

          • 2. Re: New MAC user frustrations
            Tom_Droz

            Bev

             

            Maybe I wasn't very clear about what I am doing  As an example on a windows install I create a directory called c:\mysolution where I put a start up file and some other odds and ends.  I also create a directory c:\SolutionPhotos\Large and c:\SolutionPhotos\Small.

             

            The solution is scripted to write to those 2 folders.

             

            I am try to do the same on a MAC

            • 3. Re: New MAC user frustrations
              skywillmott

              Hi Tom,

               

              This sounds like something you could do using AppleScript... There is a 'Perform AppleScript...' script step in FileMaker for Mac... The AppleScript could be something like this:

               

              tell application "Finder"

                make new folder at (path to desktop) with properties {name:"MyFolder"}

              end tell

               

              Otherwise, maybe use a plugin such as 360works ScriptMaster - 360Works ScriptMaster: Free FileMaker Modular Plugin

               

              Hope this helps,

               

              Sky.

              • 4. Re: New MAC user frustrations
                mtwalker

                If you need the directories created during install you can use a installer application and run a simple applescript to create the directories. I use Apple's Packagemaker however it has been deprecated so I am looking at other options such as: WhiteBox - Packages. There are other option out there, some of which are free.

                 

                You could also use a free plugin such as BaseElements to check for a create the directories as part of your startup script. https://www.goya.com.au/baseelements/plugin

                 

                Unless for some reason you need to install the plugins manually, you can just use FileMaker's Install Plug-In File script step to install the plugin from a container.

                Install Plug-In File

                • 5. Re: New MAC user frustrations
                  Tom_Droz

                  thanks Sky

                   

                  How would I do this manually?

                  • 6. Re: New MAC user frustrations
                    Tom_Droz

                    Todd

                     

                    I am just trying to do this manually before I try to script it

                    • 7. Re: New MAC user frustrations
                      seikos1

                      Hi Tom,

                       

                      I am the opposite of you, I use the Mac 99% of the time and the PC 1%.

                      You can use Filemaker to create and verify the existence of Directories (Folders in the Mac world).

                       

                      Or as stated above you can automate most tasks like this with Applescript. Cool thing about Filemaker is that it can execute Applescript commands directly from scripts, which makes Filemaker on the Mac very powerful.

                       

                      Ex. Script Step

                       

                      Perform Applescript(set MyFolder to (path to documents folder as string) & "TargetFolderName:")

                      If [Get (LastError) ≠ 0]

                           Show Custom Dialog ["oops"; "The Critical Folder was not found on this Mac."]

                           Exit Script []

                      End if

                       

                      If the error occurs, use the Applescript from Sky to create the needed folder.

                       

                      Steve

                      • 8. Re: New MAC user frustrations
                        mtwalker

                        If your solution is runtime, you just include the plug-in in the extensions folder when you create the installer.

                         

                        If the solution requires Filemaker to be installed on the client's computer, you can tell the installer copy the plugin to the FileMaker extensions folder. However, this can be a little tricky because you don't know for certain what version of FileMaker they have and where they have it installed. Using the "Install Plug-In File" script step will be much easier.

                        • 9. Re: New MAC user frustrations
                          Tom_Droz

                          You are all being so helpful but your a mile ahead of me

                           

                          without using Filemaker, or a script, how do I create the folders on my MAC?

                          • 10. Re: New MAC user frustrations
                            hbrendel

                            In "Finder" menu "File" item "New Folder"

                            • 11. Re: New MAC user frustrations
                              beverly

                              Yes, You need to look at Mac installer apps.

                              • 12. Re: New MAC user frustrations
                                user1069

                                One other thing... to be a good Mac citizen you should avoid writing anything to the root of the volume. Your solution would be written to either /%VOLUME%/Applications/MySolution/ or to ~/Applications/MySolution depending on whether it should be installed for all users of the computer, or only the current user.

                                (Here %VOLUME% refers to the boot disk, which is usually called "Macintosh HD" and the tilde ~ refers to the current user's home folder)

                                 

                                Likewise, your Small and Large photo folders should be stored in either /%VOLUME%/Library/Application Support/MySolution/Photos/ or in  ~/Library/Application Support/MySolution/Photos/ depending on whether they're stored for all users or only the current user of the solution.

                                 

                                All of this can be scripted, either natively with FileMaker Pro paths or using AppleScript. If you use a Mac installer app that is another avenue you have for specifying the target folder for your files.

                                • 13. Re: New MAC user frustrations
                                  Tom_Droz

                                  Thanks, so I need to create a folder in a folder to create the structure I described?

                                  • 14. Re: New MAC user frustrations
                                    steve_ssh

                                    Hello Tom,

                                     

                                    Below I've got some information that I hope will be helpful to you once you've got your feet on the ground with some of the basics that you are currently learning, e.g. how to create folders/directories manually, etc.

                                     

                                    Good luck and best wishes!

                                     

                                    -steve

                                     

                                     

                                    OSX Terminal Application:

                                     

                                    If you are coming from a batch file situation, you might find it gratifying to explore using the OSX Terminal application for performing simple tasks such as creating folders.

                                     

                                    Using the Terminal application, one can use a whole slew of shell script commands to query and manipulate the OSX environment.

                                     

                                    The Terminal application is located in the Utilities sub-directory of the root-level Applications directory.

                                     

                                     

                                     

                                    Creating a new directory using a shell script command:

                                     

                                    Using the Terminal application, the mkdir command can be used to create a new directory.

                                     

                                    As an example, to create one of the folders that user1069 suggested, the syntax would be as follows:

                                     

                                        mkdir -p ~/Library/Application\ Support/MySolution/Photos/

                                     

                                    The -p option specifies that intermediate folders should be created as necessary.

                                     

                                    The backslash before the space char is for escaping, to indicate that there is a space char in the specified path.

                                     

                                    Typing the above command into a new Terminal window should create the desired directory.

                                     

                                     

                                     

                                    Invoking a shell script from AppleScript:

                                     

                                    Shell scripts can be invoked using AppleScript using the do shell script command.

                                     

                                    The most simple AppleScript to perform the above example (i.e. no error trapping, etc.) would look something like the following:

                                     

                                    do shell script "mkdir -p ~/Library/Application\\ Support/MySolution/Photos/"

                                     

                                    Note that the backslash has now been escaped with another backslash.  This is because the entire shell script is now a quoted string.

                                     

                                     

                                     

                                    Invoking an AppleScript from FileMaker:

                                     

                                    The above AppleScript, could be invoked by FileMaker, and the script step would look something like the following:

                                     

                                    perform applescript.png

                                     

                                     

                                    Additional Comments:

                                     

                                    1) Attention to detail is necessary with respect to making sure that quote and backslash chars are all properly escaped. This means keeping in mind that there are as many as three levels of escaping happening:  The shell script path; the quoted string in the AppleScript; the AppleScript command hardcoded into the FileMaker calculation dialog.  This could certainly be improved upon -- coding the command directly into the FileMaker calculation dialog as I did above is not necessarily the best way to do this, but I felt that it helped to focus on just the parts that I think you most need to see right now.

                                     

                                    2) I wouldn't say that the shell script approach is better than an all-AppleScript approach, it's just a different approach.  Ideally, both approaches (and some others) could all comfortably fit into your toolbox, and you can choose what to use based on your own coding preferences, and the specific circumstances of the need.

                                    1 2 Previous Next