Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Import multiple html files

Featured Replies

Yes, I can import html files by using the Import-->File...-->Tab-Separated.

But when I try this with a folder, FM gripes it isn't the right file format. I need to automate this process, as I have several hundred pages to import and parse out.

Is there a way to do this?

I would recommend the ScriptMaster plugin's example function 'list all files in a directory'. That will generate a list of all files in the folder. Storing said list in a field, you can then get individual filenames/lines from this list, using the GetValue(line#) function, and import them one by one in a loop. You may need to do a global substitution with the Paragraph symbol for CRLF's prior to using GetValue. You can then import each file sequentially. Alternately an AppleScript, Troi File plugin, or shell command can be used to generate the directory listing instead of ScriptMaster.

If you want to do this in two lines of code, perhaps issuing a single shell command to append all the files to a single file, followed by an import, would be best. i.e. cat path*.html path2combined.html where cat = concactenate shell command under OSX. That would combined all files in path which end in html, to the single file combined.html. You can run the shell script via an AppleScript OR using ScriptMaster.

Edited by Guest

A variation of fseipel's AppleScript idea, but to do each file separately.


global aName

global aContents



set aFolder to choose folder

-- you could use a fixed folder instead

tell application "Finder"

	set file_list to (files of aFolder whose name extension is in {"txt", "emlx", "htm", "html", "log"}) as alias list

	-- "emlx" are default Mail files

	if file_list is not {} then

		repeat with aFile in file_list

			set aName to name of aFile

			set posix_file to quoted form of POSIX path of aFile

			set aContents to do shell script "cat " & posix_file

			-- do shell script converts Unix to Mac returns

			my FM_Create_Record()

		end repeat

	end if

end tell



on FM_Create_Record()

	tell application "FileMaker Pro Advanced"

		tell window 1

			set new_rec to (create new record)

			set cell "Filename" of new_rec to aName

			set cell "Contents" of new_rec to aContents

		end tell

	end tell

end FM_Create_Record

Read_Files_of_Folder.fp7.zip

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.