Jump 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.

Drag and Drop File path

Featured Replies

hello,

i am trying to write a script in which you drag a file/folder/volume onto an applescript applet ,it then creates a new record for each file and puts in the filepath into a cell called "filepathtext" .

Thanks for any help

Yours

Paul Apted

  • Author

Here is the script that doesn't work

error is : can't set alias ......

on open soundfile

display dialog

Although you are basically on the right track, you've likely violated one of applescript's quirky syntax rules; I didn't spend a lot of time looking at what you did. But why reinvent the wheel? I found the following general purpose applescript at Apple's website. I modified it to work with filemaker:


-- the list of file types which will be processed

-- I used graphics file types to test  this. You will have to change them to the

-- file types for whatever sound files you want to process

property type_list : {"PICT", "JPEG", "TIFF", "GIFf"}



-- This droplet processes both files or folders of files dropped onto the applet

on open these_items

	repeat with i from 1 to the count of these_items

		set this_item to (item i of these_items)

		set the item_info to info for this_item

		if folder of the item_info is true then

			process_folder(this_item)

		else if (alias of the item_info is false) and (the file type of the item_info is in the type_list) then

			process_item(this_item)

		end if

	end repeat

end open



-- this sub-routine processes folders

on process_folder(this_folder)

	set these_items to list folder this_folder without invisibles

	repeat with i from 1 to the count of these_items

		set this_item to alias ((this_folder as text) & (item i of these_items))

		set the item_info to info for this_item

		if folder of the item_info is true then

			process_folder(this_item)

		else if (alias of the item_info is false) and (the file type of the item_info is in the type_list) then

			process_item(this_item)

		end if

	end repeat

end process_folder



-- this sub-routine processes files

-- by creating new FM records and saves the filepath

on process_item(this_item)

	--You will have to change soundfile to the name of your actual filemaker

 --database in the following line

	tell document "soundfile" of application "FileMaker Pro"

		create new record

		go to last record

  --change this line to agree with your field name

		set cell "filepath" of current record to (this_item as text)

	end tell

end process_item

Although this script is somewhat long, it will go right to the bottom level of all enclosed folders to locate the files you want. So you don't have to worry about the files being at the top level.

Create an account or sign in to comment

Important Information

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

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.