Re: Newbie Question- OSX, Finder, Illustrator
Re: Newbie Question- OSX, Finder, Illustrator
- Subject: Re: Newbie Question- OSX, Finder, Illustrator
- From: Shane Stanley <email@hidden>
- Date: Thu, 31 Jan 2002 09:16:31 +1100
On 31/1/02 8:56 AM +1000, Natalie Lambert, email@hidden, wrote:
>
I'm attempting to script my job so I can have more
>
quality time with the break room vending machine. But
>
I can't get the boss to buy me a book. Its been fun,
>
really.
>
>
So.... I am having a problem with two scripts. One for
>
the finder and the other for Illustrator 10. Each work
>
the first time through without a hitch. If you save
>
the finder app and try to run the script it has
>
issues. If you run the illustrator 10 script a second
>
time it laughs at you, not really - that would almost
>
be amusing. It only seems to do part of the script.
>
>
--Finder Script
>
tell application "Finder"
>
activate
>
select every item of folder "Foldername" of disk
>
"Servername"
>
copy selection to folder "otherfoldername" of disk
>
"MacintoshHD"
>
select every item of folder "Foldername" of disk
>
"Servername"
>
delete selection
>
end tell
Try something like this:
tell application "Finder"
try -- in case there aren't any items in the folder
duplicate every item of folder "Foldername" of disk "Servername" to folder
"otherfoldername" of disk "MacintoshHD" with replacing
delete every item of folder "Foldername" of disk "Servername"
end try
end tell
>
>
--Illustrator 10 Script
>
tell application "Illustrator 10"
>
activate
>
select every group item of current document
>
copy selection
>
close document saving no
>
make new document {properties blah, blah, blah}
>
paste
>
end tell
>
>
it copies and pastes correctly when testing out of
>
script editor the first time but the second time you
>
end up with a new page with nothing on it. its not
>
copying the selection to the pasteboard.
Don't use copy and paste where you can avoid it. Try this:
tell application "Adobe Illustrator 10"
make new document at beginning with properties {...}
duplicate every group item of document 2 to end of document 1
close document 2 saving no
end tell
--
Shane Stanley, email@hidden