Need help making script to create a new folder based on dropped file

I’m working on a script to automate the creation of a set series of folders using the filename of the file dropped on the droplet:

  1. An jpeg file is dropped on droplet
  2. Script gets the file’s name (only the name without the extension)
  3. Script creates a new folder with the extracted name in a fixed location
  4. Script creates 2 new folders inside the previous folder. Folder have fixed names.
  5. Set folder view options

There are a few ways I can accomplish this series. I’ve got a script started now but this could be accomplished (partly) with an Automator workflow.

I can get 1,3-5 to work on my own. My problems are:

a) I can’t get it to determine the dropped file’s name without the extension.
b) I can’t get it to work if more than one file is dropped on the droplet (AppleScript app)

I have searched AutomatorWorld.com and here and none of the ‘get file name’ solutions seems to work for me.

Here’s psudo-code for what I have so far:

on open imagename tell application "Finder" -- code determine file name here make new folder at *location* with property {name: extracted_name} -- Parent folder make new folder at *location inside parent folder* with property {name: "full-size"} -- Subfolder make new folder at *location inside parent folder* with property {name: "thumbnails"} -- Subfolder -- code to set folder views here set combined_name to extracted_name & ".jpg" move file combined_name of *location 1* to *full-size in folder I created above* move file combined_name of *location 2* to *thumbnails in folder I created above* end tell end open
I can get everything else to work fine but I can’t seem to solve the ‘get file name’ problem.

Any ideas? Thanks for your help!

Model: iMac DV SE (Summer 2001); OS X 10.4.6
AppleScript: 1.10.6
Browser: Safari 417.9.3
Operating System: Mac OS X (10.4)

What about something like:

on open TheFile
	tell application "Finder" to set FileName to (name of item 1 of TheFile) -- Or you could make a loop to deal with multiple dropped items
	set ASTID to AppleScript's text item delimiters
	set AppleScript's text item delimiters to "."
	set extracted_name to text item 1 of FileName
	set AppleScript's text item delimiters to ASTID
-- Continue with rest of script using extracted_name as you indicated
end open