What script should I use to open a view with the same criteria?

What script should I use to open a view with the same criteria?

I have a view with a custom function. the function opens an edit window on click and when the edit is committed it returns the user to the view with the edits implemented. The script that returns the user to the main view is:
openUrl("#View:Tasks", "same window");

However, when a user selects a filter to narrow their view and then uses the custom function, the user is returned to the view WITHOUT the previously selected filter. Is there a way to change this script to include the previously selected filter when the user is returned to the view?

When I remove the script above, the user returns to the view with the filter, but there is nothing to reload the view to include the edits that were just made.

Any ideas on how I can script this to load the exact view that the user was just looking at and have the edits made appear after the function is executed?

Brent