• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

1stplugins

FileMaker plug-ins and Reverse Engineering

  • Plugins
    • MediaManager
  • Services
    • Reverse Engineering
    • FileMaker Plug-Ins
  • About
    • About Us
    • Contact Us
    • Terms of Use of the Website and Privacy Policy
  • Store
    • Terms and Conditions
    • Warranty Claim Guidelines
    • Contract Withdrawal Form
    • Warranty Claim Report

Media_SetDefaultFolder

Media_SetDefaultFolder ( path )

Media_SetDefaultFolder sets the default folder for all MediaManager functions that depend upon a file path.

Parameter Description
path Any absolute path or path relative to the current default folder. See also special values below.

Special values for path

Value Meaning
.A Applications (Mac) or Program Files (Windows) folder
.D Desktop
.F The folder containing the currently active FileMaker Pro application
.O Documents folder
.P Preferences folder
.R The root folder of the boot disk
.S System folder
.T Temporary folder
.U:prompt user selects a folder from the folder dialog
.V:prompt user selects a file from the file dialog. Returns filename, sets default folder to the file’s enclosing folder.
.W Windows folder (Windows only)
.X Trash folder
.@ Downloads folder
.d Documents folder
.m Music folder
.p Pictures folder
.v Movies folder (Mac), Videos folder (Windows)

The above codes can be used anywhere a file path is expected. Special values can be combined with relative paths. For example, “.D/foobar/image.jpg” refers to the file image.jpg inside the images folder on the desktop.

At startup, the default folder is set to the root disk.

Path Syntax

All paths to files and folders used by MediaManager follow the conventions of FileMaker Pro. An absolute path starts with slash; relative paths do not. A path to a folder ends in slash; a path to a file ends with the file name. Here are some examples:

An absolute path to a user directory named “Frank” on the Mac:

/Macintosh HD/Users/Frank/

An absolute path to a user directory named “Frank” on Windows Vista and newer:

/c:/Users/Frank/

A relative path to a file named “MyFile.txt” located on the desktop:

.D/MyFile.txt

The Default Folder

MediaManager uses the convention of the “default folder”. This path is set either by using the Media_SetDefaultFolder function or by Set Default Folder script step and is automatically prepended to every file or folder path specified in MediaManager functions. In other words, you can set the default path to any folder, and then simply set all paths to be relative to that default location.

For example, suppose the default path is set to the Desktop folder, with either one of the following:

Set Field [ MyTable::Response ;
Media_SetDefaultFolder (
"/Macintosh HD/Users/Frank/Desktop/"
) ]

Set Field [ MyTable::Response ;
Media_SetDefaultFolder ( ".D" ) ]

If you then use a MediaManager function like Media_ExportField or Export Field script step, you can simply list the file name in the path parameter, and the file will be exported to the desktop (the default folder):

Set Field [ MyTable::Response ;
Media_ExportField (
MyTable::Picture 1 ;
"image.jpg" ;
False
) ]

Similarly, if you want to specify a folder within the default folder, you only need to list the folder and file name, and MediaManager understands that you are specifying a location relative to the default folder (again, the desktop):

Set Field [ MyTable::Response ;
Media_ExportField (
MyTable::Picture 1 ;
"MyPictures/image.jpg" ;
False
) ]

Of course, you can specify a full path at any time and the default path is ignored.

Other Special Notations

../ refers to the enclosing or “parent” folder. It is the equivalent of going “up one level” in the current default path.

For example, if you set the default path is set to a user directory like this–

Set Field [ MyTable::Response ;
Media_SetDefaultFolder (
"/c:/Documents and Settings/Frank/"
) ]

–you can then specify the Users directory with “../”, such as in a Export Field script step like:

Set Field [ MyTable::Response ;
Media_ExportField (
MyTable::Picture 1 ;
"../image.jpg" ;
False
) ]

Returns

An empty string if successful. Otherwise, returns an error message.

With either of the user prompt options (.U and .V), if a user clicks on the Cancel button, MediaManager returns “$0:Cancel”.

Examples

To set the default folder to the desktop:

Set Field [ MyTable::Response ;
Media_SetDefaultFolder ( ".D" ) ]

To set the default folder to the boot disk:

Set Field [ MyTable::Response ;
Media_SetDefaultFolder ( ".R" ) ]

To allow the user to select the default folder with the message “Select a default folder”:

Set Field [ MyTable::Response ;
Media_SetDefaultFolder (
".U:Select a default folder"
) ]

Primary Sidebar

Document Functions

Media_CopyItem
Media_CreateAlias
Media_CreateFolder
Media_DeleteItem
Media_ExportField
Media_ExtractInfo
Media_GetDefaultFolder
Media_GetItemInfo
Media_GetName
Media_GetPath
Media_InsertFile
Media_ListDisks
Media_ListFolder
Media_MoveItem
Media_OpenItem
Media_RenameItem
Media_SetDefaultFolder

General and Registration Functions

Media_Get
Media_GetLastError
Media_GetMouseUp
Media_JSONPath
Media_Register
Media_RegisterLicensedEncoder
Media_Set
Media_Version

Image Functions

Media_TApply
Media_TClear
Media_TCrop
Media_TQuad
Media_TResize
Media_TRotate
Media_TScale
Media_TSkew
Media_EffectApply
Media_EffectDialog
Media_ConvertImage
Media_GetImageInfo
Media_GetMetadata
Media_InsertImage
Media_ListImageOutputTypes
Media_SetImageDefaults

Script Steps

Copy Item
Create Alias
Create Folder
Delete Item
Export Field
Get Default Folder
Get Item Property
Move Item
Open Item
Rename Item
Set Default Folder

Sound Functions

Media_Amplify
Media_AppendSound
Media_ConvertSound
Media_CreateSound
Media_DrawWaveform
Media_ExtractSound
Media_FadeSound
Media_GetMetadata
Media_GetSoundInfo
Media_InsertQuickTime
Media_ListSoundOutputFormats
Media_MixSounds
Media_Normalize
Media_PlayPause
Media_PlaySound
Media_RecordSoundFormatDialog
Media_RecordSoundStart
Media_RecordSoundPause
Media_RecordSoundStop
Media_SetMetadata
Media_SoundFormatDialog
Media_StopSound

Video Functions

Media_GetVideoInfo

Footer

Let’s get started on your project.

Get in touch

  • Plugins
  • Services
  • About
  • Store

Copyright ©2006-2020 by 1stplugins, s.r.o. All rights reserved.