New folder and paste clipboard as name,

New folder and paste clipboard as name, I did my homework and tried to see it the answer was here in other posts, but I could not make it work. I solved the new folder and tried many of “paste” options I found here.
Final goal is, File Maker Pro 7, - run FMP script which copies “cell info” and runs this apple script to make new folder and paste copied name from Filemaker Pro script. Ultimately I can create a PDF in this new folder. Noob, I prefer “newon”, but learn fast. Currently preform basic print and “action” scripts in FMP.

OS 10.3.9 will be Tiger soon.
New foldercurrent script is: (works fine)

tell application “Finder”
set nf to make new folder at “Yavapai:users:jp:Home Inspection 10/05:2005 Inspections”
end tell

some options I tried as paste were:
tell application “System Events” to keystroke “V” using command down

tell application “System Events” type text “v” holding down command

tell process “Finder” to keystroke “v” using command down
end tell

FOLLOW UP question- what is the easiest way to script FMP, “Preform Apple Script” has options of “Native” or “Calculated” is Send Event an option? OR is it easier to go from the Finder into FMP to get the results I was ultimately after, A folder with a specific name. Should be simple.

Thanks for you help, this is probably the simplest script for you

Joe
joemed@cableone.net

Model: IBook
AppleScript: Script Editor 2.0
Browser: Safari 312.3.1
Operating System: Mac OS X (10.3.9)

In its most simple form, and assuming that the clipboard contains text:

tell application "Finder"
	activate -- The Finder should be frontmost to use the clipboard.
	set nf to (make new folder at folder "Yavapai:users:jp:Home Inspection 10/05:2005 Inspections:" with properties {name:(the clipboard)})
end tell

If the script’s to be run from FMP while that’s the frontmost app, and you don’t want to bring the Finder to the front, you should be able to use a variable instead:

set newName to (the clipboard) -- Assuming the script's being run by the frontmost application.
tell application "Finder"
 	set nf to (make new folder at folder "Yavapai:users:jp:Home Inspection 10/05:2005 Inspections:" with properties {name:newName})
end tell

I don’t know anything about scripting FMP, so I can’t answer your second question. It might be a good idea to post it separately with a subject line that identifies it as an FMP problem. It’s more likely to catch the eye of an FMP expert that way. Good luck. :slight_smile:

PS. It’s generally considered a bit dodgy to use “/” in OS X file or folder names, as this is the Unix path separator. (ie. It has the same function as the “:” in Mac OS paths.) It’s not absolutely forbidden, but it can cause problems in some situations.

Thank you so much, I worked great. Something so simple and, I looked and searched and was surprised how difficult it was to find.
I’ll play with FMP over the holidays and see if I can get it to work.

Thanks again, & happy holidays to your and your family,

Joe

I have just had occasion to use this script in FMP 8 on an OS X Server to populate my Home Directories Server for 1200 pupils and it works fabulously so thank you soo much for asking about this. If you need help with the FMP part let me know.