-
Copying files from CD-ROM to mac desktop through Flash Projector
Hi,
This is my first post and it's a bit of a biggie. I have created a Flash based menu system which allows the user to view thumbnails of .eps files and download the individual files to their desktop for editing. I have this working flawlessly on the PC using Northcodes utilities but the MAC side is giving me a bit of a headache.
So far I have used the fscommand exec in flash to execute a applescript to do the job. My applescript knowledge was non existant until 2 days ago. I found this script and have implemented it,
Code:
tell application "Finder"
activate
with timeout of 1200 seconds
copy folder "CDTITLE:test.eps" to desktop
tell application "Finder"
close the front window
end tell
end timeout
end tell
I have created seperate applescripts for the individual .eps files.
The applescript works fine for the first file that is clicked to download but when the user clicks on another file the applescript errors and says
"Can't get window 1 of application "Finder" "
Any ideas what is causing this and is there a workaround or maybe a different script to do the same job?
Thanks,
d31irious
-
Senior Member
It's caused by the 'close the front window' statement, if there is no window open then the finder cannot close the frontmost window.
I don't think you'd even need that statement actually, you could just use the 'copy folder' line.
Sam
-
Thanks for the reply.
I have tried eliminating that line, but when the user clicks on a file to download, finder places all open folders infront of the projector window. However the error does disappear.
Do you know to a line of script which would bring the focus back to the projector window?
-
Senior Member
You can put a line in that says something like:
tell application "MyProjector"
activate
end tell
Where MyProjector is the name of your application as it appears in the top left corner menu.
Sam
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|