Re: "set name" not working - newbie question -urgent
Re: "set name" not working - newbie question -urgent
- Subject: Re: "set name" not working - newbie question -urgent
- From: "Tracy Vanderwerf" <email@hidden>
- Date: Fri, 12 Apr 2002 13:32:03 -0400
- Organization: White Directory Publishers
Here's how I finally got this to work. What I don't understand is that I actually get the "on
error" condition for the COPY_ARTID "get".
I removed the "display dialog" I had there and the script then continued on to completion.
tell application "Finder"
display dialog "into finder"
try
--select container fileContainer
--select
--select file COPY_ARTID of container fileContainer
get item COPY_ARTID of container fileContainer
on error
end try
try
set name of item COPY_ARTID of container fileContainer to ARTID
on error
end try
end tell
end if
Tracy Vanderwerf wrote:
>
I am trying to rename a file. This works outside of my script, which has
>
>
a run handler. My code is in a subroutine that is using Stuffit
>
Expander. After my file is expanded, it has the name 41275.A.1 (I have
>
trashed the original 41275.A prior to this). I want to rename the
>
expanded file to 41275.A. I am getting an error on selecting the folder
>
fileContainer. As I said, this works fine outside the script:
>
>
if got_new_expandpath then
>
getcontainer2(save_filepath)
>
display dialog "fileContainer = " & fileContainer
>
set oldDelimiters to AppleScript's text item delimiters
>
set AppleScript's text item delimiters to {":"}
>
set COPY_ARTID to the last text item of new_expandpath as string
>
set AppleScript's text item delimiters to oldDelimiters
>
display dialog "after setting text item COPY_ARTID = " &
>
COPY_ARTID
>
tell application "Finder"
>
try
>
select folder fileContainer
>
select file COPY_ARTID of folder fileContainer
>
set name of selection to ARTID
>
on error
>
display dialog "error on select "
>
end try
>
end tell
>
end if
>
>
Thanks in advance for your help. (MAC OS 9.0.4, AppleScript 1.4.3)
>
>
[demime 0.98b removed an attachment of type text/x-vcard which had a name of tvanderwerf.vcf]
>
_______________________________________________
>
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.
[demime 0.98b removed an attachment of type text/x-vcard which had a name of tvanderwerf.vcf]
_______________________________________________
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.