Re: Passing String Variables to Visual Basic withinApplescript???
Re: Passing String Variables to Visual Basic withinApplescript???
- Subject: Re: Passing String Variables to Visual Basic withinApplescript???
- From: Ian MacLachlan <email@hidden>
- Date: Sun, 24 Jun 2001 16:45:18 -0700
Is it possible to process Word files using TIDs? How would you do that? Like
this?
on process_item(this_item, old_string, new_string)
-- note that the variable this_item is a reference in alias format
--
try
set the this_item to the this_item as text
set the open_this_item to open for access file this_item with write
permission
set this_item to alias ((this_folder as text) & (item i of these_items))
replace_chars(this_item, old_string, new_string)
close access the open_this_item
return true
on error
try
close access file this_item
end try
display dialog "Error in Writing To Target File!"
return false
end try
end process_item
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
Paul Berkowitz wrote:
>
On 6/24/01 3:12 PM, "Greg Strange" <email@hidden> wrote:
>
>
> Is there some reason why you aren't using AppleScript's text item
>
> delimiters? Using Word is slow, slow, slow.
>
>
Actually using VBA in Word is extremely fast. Of course for anything that
>
doesn't require AppleEvents at all and can be done with TIDs there's no
>
point using any application. It will always be much faster in pure
>
AppleScript. But for anything that actually requires Word, using 'do Visual
>
Basic' is not like 'regular' (flawed) applescripting in Word: it works very
>
fast indeed. It's a real shame that that's how things are, but they are.
>
>
--
>
Paul Berkowitz
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users