Ok folks - I am going insane here! Just to make sure that the problem was not in some surrounding code (like where the BBedit tell was placed), I moved all of the BBedit stuff to its own handler, passed the variables to that handler then tried it there.
on grep_it(current_name, new_item_name)
tell application "BBEdit 6.5"
activate
if current_name = "CBB91F15-10D9-4A91-9C6D-84F29E93F44F" then
beep 2
display dialog ("The string is correct")
end if
--set current_name to "CBB91F15-10D9-4A91-9C6D-84F29E93F44F"
replace current_name using new_item_name saving yes searching in alias "Macintosh HD:Usersld_bfindlay:Sites:" options {search mode:grep, case sensitive:true, match words:false, extend selection:false, showing results:true}
end tell
end grep_it
The above code does display the dialog - indicating that this handler sees the correct string value, yet fails on the replace. (BBedit activates, cranks through the files, but fails to find or replace anything - no results window pops up.)
However, if i uncomment set current_name to "CBB91F15-10D9-4A91-9C6D-84F29E93F44F", just before passing it to the replace command, it works! Holy Crap Batman - it is THE SAME value!! Tested by the if logic. If I set it manually, it works, if I set it by passing the variable into the handler, it doesn't! (Course without accepting the variable, the entire script is useless!!)
-Brick walled on this one.
on grep_it(current_name, new_item_name)
tell application "BBEdit 6.5"
activate
if current_name = "CBB91F15-10D9-4A91-9C6D-84F29E93F44F" then
beep 2
display dialog ("The string is correct")
end if
--set current_name to "CBB91F15-10D9-4A91-9C6D-84F29E93F44F"
replace current_name using new_item_name saving yes searching in alias "Macintosh HD:Usersld_bfindlay:Sites:" options {search mode:grep, case sensitive:true, match words:false, extend selection:false, showing results:true}
end tell
end grep_it
The above code does display the dialog - indicating that this handler sees the correct string value, yet fails on the replace. (BBedit activates, cranks through the files, but fails to find or replace anything - no results window pops up.)
However, if i uncomment set current_name to "CBB91F15-10D9-4A91-9C6D-84F29E93F44F", just before passing it to the replace command, it works! Holy Crap Batman - it is THE SAME value!! Tested by the if logic. If I set it manually, it works, if I set it by passing the variable into the handler, it doesn't! (Course without accepting the variable, the entire script is useless!!)
-Brick walled on this one.