I am a graphic artist. I know enough about scripting to get by but I far far
from an expert.
i am sure this is really simple, but its beyond me…
description:
when an item (text doc) is placed into a folder: text-edit plus will activate
and search said document for a specific term (LCLPGAD)
the script will then report/display to the user the number of times it finds
the term - prompting the user to take further action with “OK” or “Cancel”
if “OK” the script would then activate the FTP program (Yummy FTP) , telling it
to use a specified bookmark and then upload the file - the dialog disappears
if “Cancel” nothing happens, the dialog disappears, everything closes and the
script ends
_
this where i am at (needless to say it doesnt compile - think i have the
text-edit portion correct it the upload part that is wrong or the prompt that is
wrong…i dunno - i havnt done the cancel portion)
i am clueless…don’t laugh : ( thank you in advance
on adding folder items to this_folder after receiving added_items
tell application "Tex-Edit Plus"
set y to "LCLPGAD"
set numwins to (get number of windows)
set countr to 0
set loopflag to false
set x to 1
repeat until x = (numwins + 1)
repeat
if loopflag is false then
search window x looking for y with whole words matching and cases matching
copy result to sresult
end if
if loopflag is true then
search window x looking for y with searching from cursor, whole words
matching and cases matching
copy result to sresult
end if
if true is in the sresult then
copy countr + 1 to countr
set loopflag to true
select insertion point after selection of window x
end if
if false is in the sresult then exit repeat
end repeat
copy x + 1 to x
set loopflag to false
end repeat
set time_ to " times in "
if countr = 1 then set time_ to " time in "
set doc_ to " documents"
if numwins = 1 then set doc_ to " document."
display dialog "Found term:" & return & return & " " & y & return & return &
countr & time_ & numwins & doc_ buttons {“Cancel”, “OK”} default button “OK”
with icon note
if button returned is equal to “OK” then
tell application “Finder”
activate “Yummy FTP”
end tell
tell application “Yummy FTP”
connect “zap”
end tell
repeat with this_item in added_items
tell application "Yummy FTP"
using connection "zap" upload this_item
end tell
end repeat
tell application "Yummy FTP"
disconnect "zap"
end tell
end adding folder items to
Browser: Safari 523.12
Operating System: Mac OS X (10.4)