semi newbie question on open vs choose folder
semi newbie question on open vs choose folder
- Subject: semi newbie question on open vs choose folder
- From: John Haley <email@hidden>
- Date: Wed, 2 Apr 2003 21:02:15 -0600
Below I have written a script (I am sure it is not up to your
standards, but I try) I can't get it to work right as is, but if I get
rid of the "on open originalPathHold" and use
choose folder
set originalPathHold to result
it works as i expect it to.
The part that doesn't work is the deleting of the files/folders on
originalPathHold and the eject (The files will be coming from a camera
usually and one or two of the files are not accessible to be thrown
away in OS X).
Will be running in OS X and OS 9.
Any help would be appreciated.
Thanks
John Haley
on open originalPathHold
tell application "Finder"
activate
set originalPath to originalPathHold as string
set tempPath to startup disk as string
set tempPath to tempPath & "Library:"
set tempFolder to tempPath & "FileMaker Downloaded Photos"
if exists folder "Library" of startup disk then
else
make new folder at startup disk with properties {name:"Library"}
end if
try
delete folder tempFolder
end try
try
make new folder at tempPath with properties {name:"FileMaker
Downloaded Photos"}
on error
display dialog "No pictures imported. We are in trouble"
quit
end try
try
copy folder originalPath to folder tempFolder
on error
try
copy file originalPath to folder tempFolder
on error
set originalPathList to originalPathHold as list
repeat with theFileorFolder in originalPathList
try
copy folder theFileorFolder to folder tempFolder
on error
try
copy file theFileorFolder to folder tempFolder
on error
display dialog "No pictures imported. We are in trouble"
quit
end try
end try
end repeat
end try
end try
end tell
set pause to the (current date)
set pause to pause + 20
repeat while pause is greater than the (current date)
end repeat
tell application "Finder" to set deletelist to every item in
originalPathHold
tell me to activate
repeat with deleteItem in deletelist
set deleteItemstring to deleteItem as string
if deleteItemstring !A originalPath then
try
tell application "Finder" to move deleteItemstring to the trash
end try
end if
end repeat
tell application "Finder"
empty the trash
set pause to the (current date)
set pause to pause + 20
repeat while pause is greater than the (current date)
end repeat
try
eject disk originalPathHold
end try
try
move originalPathHold to the trash
end try
try
empty the trash
end try
end tell
set desktopPath to the path to the desktop as string
set mainProgram to desktopPath & "Main Program"
tell application "FileMaker Pro"
activate
open mainProgram
go to document "Main Program"
tell document "Main Program"
do script "Import Pictures"
end tell
end tell
end open
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.