New to AS... What am I doing wrong?
New to AS... What am I doing wrong?
- Subject: New to AS... What am I doing wrong?
- From: CP <email@hidden>
- Date: Wed, 10 Mar 2004 12:06:31 -0500
Hey everyone, I read through these lists from time to time but have
never posted. I'm pretty new to AppleScript, but I understand some of
the fundamentals so far. I'm trying to modify a script that came with
the "BigCat" contextual menu plugin. The CM just lets you choose & run
one of the apple scripts located in a folder in the library.
So I'm trying to modify this script that copies the path of the
specified file or location to the clipboard. If you just select a
blank area of a window, it'll copy the directory path of that window.
So heres the original:
on main(filelist)
set s to ""
set ctitems to count of items in filelist
repeat with i from 1 to ctitems
set s to s & ((item i of filelist) as string)
if i < ctitems then
set s to s & ", "
end if
end repeat
set the clipboard to (s as string)
end main
And I'm trying to get it to copy a file from a specific location to the
location that the original script adds to the clipboard.
Like so:
on main(filelist)
set s to ""
set templateFile to ""
set ctitems to count of items in filelist
repeat with i from 1 to ctitems
set s to s & ((item i of filelist) as string)
if i < ctitems then
set s to s & ", "
end if
end repeat
set the clipboard to (s as string)
set templateFile to "Macintosh
HD:Users:cpruitt:Desktop:americanexpress.com/paperles.textClipping"
tell application "Finder"
activate
duplicate templateFile to (s as string) --"Macintosh
HD:Users:cpruitt:"
end tell
end main
It seems to still copy 's' to the clipboard, but wont copy the file to
that location. If I manually use a path (commented out) instead of a
variable it works fine. Anyone have any thoughts on what I need to
change to get it to work?
Thanks from the new guy...
- Cliff
_______________________________________________
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.