He went from Paris back to Vienna, where he worked as a secretary in an ironworks corporation. Then he left for Sarajevo, where he was the secretary of the National Bank. He published essays and articles in Kranjčević's Nada and literary magazines in Zagreb. In 1905 he went to Tuzla and opened his own legal practice. He stayed in Tuzla till 1920 and developed strong legal and Croatian patriotic activities. As he studied the conditions in Bosnia, especially the position of the Croatian people, he actively engaged in politics, believing that Croats should be more forceful in defending their interests in Bosnia and Herzegovina.
He published the brochure Archbishop Štadler and the Croatian National Community (Sarajevo, 1908), which was opposed by the clergy and provoked a political rift between him and the Vrhbosnian archbishop. In his brochure, Pilar concluded that the Catholic faith had undoubtedly an exceptional role in preserving the national identity of Croats in Bosnia, but he believed there were certain differences between the interests of the people and the Church as an organization. In 1910 he founded the Croatian National Community, trying to politically awaken impassive Croatian Catholics and prepare them for the incoming portentous events. When World War I started, he was still in Tuzla.
While many Croats eagerly awaited the dissolution of the hated Monarchy, Pilar warned that it was the only guarantee for a Croatian identity and that the country had to be reformed, but not destroyed. He published the essay World War and the Croats. An Attempt to Orient the Croatian People Even Before the War Ends in Zagreb in 1915, under the pseudonym dr. Jurčić. He was convinced that the Croatian political elite was lost in the contemporary events and that it was letting the Serbs take the initiative, instead of clearly formulating the goals and the program of the fight of the Croatian people in the world war. The essay was recognized by well-informed readership, so there was a second edition in 1917.
The developments in the Transleithanian part of the Monarchy were going against Pilar's wishes and beliefs, so he published a booklet of 32 pages in Sarajevo in 1918. It was called Political Geography of the Croatian Lands. A Geopolitical Study and it was the founding stone of Croatian geopolitics. Pilar was aware of its historical significance, since he said: We do not have any knowledge of any work on political geography of this kind in Croatian literature. (...) Therefore, this essay is the first of its kind in this area of our literature. In the essay, Pilar pointed out that the Croatian lands since 1908, i.e. since the Monarchy's annexation of Bosnia and Herzegovina, were incorporated in a single strong state, which guaranteed Croatian survival and where "today's Croatian lands flourish like never before".
The second edition (also published in Vienna), as stated by Pucek (see below) in his introduction to the Croatian translation, was heavily censored, since such honest but formally mild criticism of the Austrian policy in the Croatian lands in the 19th century was not allowed by the Austrian government of the time. Pilar wrote the book in German because he intended it for the German linguistic area, especially the Austrian readers, but also the military and political circles of the embattled Monarchy.
But this major work in the area of South Slav issues was immediately recognized by Serbs and other promoters of a South Slavic Union, since the book warned Croats not to enter into states that would cause their ruin. They were buying its copies in Vienna and other cities of the Monarchy to destroy them. For this reason, it became a bibliographic rarity soon after its publication.
Dubravko Jelčić, an expert on Pilar, wrote: Over many years, Pilar's book was the only systematic and clear, historically objective analysis of the Greater Serbian imperialistic idea, its genesis, goals and method (…) At the time of WWI, when the Croatian people's destiny was being decided, Pilar alias Sudland promoted mature political concepts that opposed the tragic defeatism of Trumbić and Supilo.
The third German edition of the book was printed in Zagreb in 1944, with all the faults of the censored second edition. It was finally translated to Croatian in 1943, a year before the third German edition, also with all the mentioned faults. It was translated, arranged and commented by the industrious South Slav expert Fedor Pucek and published by Matica hrvatska. Two years later, in 1945, Pucek was summarily executed by the communist regime. The second Croatian edition (1990) is just a reprint of the first.
[The Serbs] took from the Croats modern-day western Serbia, that is ancient Doclea, and one the main forces that brought to today's war [First World War] , is the continuous seeking of the Serbs, to finally snatch away both Bosnia and Herzegovina too from the Croats.
Soon after that essay was published, Pilar was found killed in his apartment. The press in Belgrade claimed it was a suicide, but the open window of his apartment and the fact that Pilar never owned a weapon make his death suspicious. Even today, there are two theories about his death: the first, that Pilar was so depressed by the Yugoslav dictatorship that he killed himself; the second, that he was killed by Serbian secret agents like other Croatian patriots such as Milan Šufflay (in 1931).
The Institute for Social Sciences in Zagreb was named after him.