Your code works for me, assuming that the first link is an incx-file. A possible reason is that the text frame is locked or on a locked layer.
Thanks for replying... If the .incx file is present in C:\Documents and Settings\Desktop\Sample (same as its location when the link is double clicked), then the unlink function works properly... But after i move the file to some other path, I m not able to perform unlink thro script, but its possible manually.
My textframe is not locked and it is not on a locked layer also...
Once you have moved the link to another location, it is missing and you are unable to unlink it by script. You have to relink it to the original file first, and only then unlink it.
Thank you for replying Kasyan...
But it is possible to unlink manually even when the file is moved to some other location. Only thro script i m not able to unlink.