Any Imacros Command/Script To Retrieve Firefox Profile Name

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Any Imacros Command/Script To Retrieve Firefox Profile Name

by ysl78 on Mon Jan 29, 2018 9:56 am

Hi,

Anyone know Imacros command or script which able to retrieve current running firefox profile name.Thanks.
ysl78
 
Posts: 1
Joined: Mon Jan 29, 2018 9:27 am

Re: Any Imacros Command/Script To Retrieve Firefox Profile

by chivracq on Mon Jan 29, 2018 11:12 am

ysl78 wrote:Hi,

Anyone know Imacros command or script which able to retrieve current running firefox profile name.Thanks.

CIM...! :mrgreen: (Read my Sig...)

Hum..., interesting Qt but it doesn't look very complicated to find a Solution, all Info/Data you are looking for is displayed on 'about:profiles' for example...:
Code: Select all
VERSION BUILD=8970419 RECORDER=FX
TAB T=1

URL GOTO=about:profiles
WAIT SECONDS=0.5

TAG POS=1 TYPE=TH ATTR=TXT:Root*
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=* EXTRACT=TXT
SET Root_Prf EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('Profiles\'); y=x[1].split(' '); z=y[0]; z;")

TAG POS=1 TYPE=TH ATTR=TXT:Local*
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=* EXTRACT=TXT
SET Local_Prf EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('Profiles\'); y=x[1].split(' '); z=y[0]; z;")

PROMPT Root_Profile:<SP>_{{Root_Prf}}_<BR>Local_Profile:<SP>_{{Local_Prf}}_
(Tested on iMacros for FF v8.9.7, FF v55.0.3, Win10_x64.)

I only have 1 (Default) Profile on my FF Env., you might need to adjust the 'POS=n' for the Header or the 'POS=Rn' for the Path if you have several Profiles...

Hum..., and this Script doesn't seem to work on Pale Moon (where I do have several Profiles...) (PM v26.3.3 + iMacros for FF v8.8.2) as PM doesn't seem to support 'about:profiles'.
Last edited by chivracq on Thu Jul 05, 2018 2:39 pm, edited 1 time in total.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7199
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Any Imacros Command/Script To Retrieve Firefox Profile

by chivracq on Wed Feb 21, 2018 1:25 pm

Pfff...!, there is no need to kind of spam the Forum by opening a Duplicate Thread (which will be deleted or merged with this one if it gets any Replies...), you could better follow up in this current one, even after 3 weeks...! :roll:

Duplicate Thread:
- Extract Number From Firefox Profiles Name Directory Path
ysl78 wrote:I am using function below to extract number from Firefox profiles name directory path:

Code: Select all
function profile(){
profile =  "CODE:";
profile +=  "VERSION BUILD=8970419 RECORDER=FX" + "\n";
profile +=  "TAB T=1" + "\n";
profile +=  "URL GOTO=about:cache" + "\n";
profile +=  "WAIT SECONDS=1" + "\n";
profile +=  "TAG POS=1 TYPE=h2 ATTR=TXT:disk" + "\n";
profile +=  "SET !EXTRACT NULL" + "\n";
profile +=  "TAG POS=R4 TYPE=TD ATTR=* EXTRACT=TXT" + "\n";
profile +=  "SET !VAR2 EVAL(\"var s='{{!EXTRACT}}'; var x,y,z,v,w; x=s.split(' '); y=x[1].split(' '); z=y[0];w=z.substr(0,8);v=w.match(/\\d+/g);v\")" + "\n";
profile +=  "SET !extract {{!VAR2}}" + "\n";
iimPlay(profile);
var ret = iimGetExtract();
return ret;
}


I am able to extract desire number "534 " from "C:\Users\USER\AppData\Local\Mozilla\Firefox\Profiles\2r33c5ze.Default User534\cache2 " with EVAL in function above. But when I try run same function on other profiles "C:\Users\USER\AppData\Local\Mozilla\Firefox\Profiles\rfbztnlf.Default User535\cache2 " , it failed to give me number "535", it will give me back whole "C:\Users\USER\AppData\Local\Mozilla\Firefox\Profiles\rfbztnlf.Default User535\cache2 " . May i know any wrong with my EVAL expression to extract desire number?

Sorry, but no Follow-up on a Thread (while I notice you are clearly using "my" Syntax) and opening Duplicates (=SPAM...!) is a "Show-Stopper" for me to help Users any further... :roll:
And your new Thread still doesn't comply with the '(F)CIM' part, even if "v8.9.7 for FF" is "vaguely" mentioned in your Script...

Delete the Duplicate and follow up in this current Thread, and mention clearly your FCI, and I might still have a look... (hum..., in 3 weeks time of course...! :wink: )
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7199
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Any Imacros Command/Script To Retrieve Firefox Profile

by chivracq on Thu Feb 22, 2018 2:01 pm

Hum, mini-Update anyway, for "other" Users who might follow/find this Thread, the 'about:cache' is indeed maybe more "practical" than the 'about:profiles' I had used in my own Example, and it works as well on Pale Moon (PM v26.3.3) while 'about:profiles' didn't work on PM v26.3.3.

But this Screen only mentions the current Profile in use for the Browser Instance.
(I do have 3 PM Profiles and the 2 other ones are not listed... I'm not sure about 'about:profiles' as I only had (and still have) 1 FF Profile when I had tested 3 weeks ago, and 'about:profiles' only works on FF...)

Still wondering a bit btw what could be the "Use" for retrieving the Profile Name from a Script, maybe for a Conditional 'CLEAR' of the Cookies if using the same Script on different Profiles, hum..., mouaw..., I don't know really... :?
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7199
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Any Imacros Command/Script To Retrieve Firefox Profile

by chivracq on Thu Jul 05, 2018 8:49 am

And some other Update, now 6 months later... 8)

(Pity @OP in this Thread never followed up on their Thread (=> Spanking deserved...! :shock: ), except opening a Duplicate 3 weeks later (=> Double Spanking deserved...! :shock: :shock: ), which like expected got deleted by the Forum Admin :D , tja...! :roll: )

But OK, I was saying...:
chivracq wrote:Still wondering a bit btw what could be the "Use" for retrieving the Profile Name from a Script, maybe for a Conditional 'CLEAR' of the Cookies if using the same Script on different Profiles, hum..., mouaw..., I don't know really... :?

=> Here is some new/current Thread with a possible Use/Need for identifying the current FF-Profile...:
- Fiddler + imacros multi-threading
(The Thread is just "starting" [2018-07-05], but it will probably be/become "Interesting", I think, ah-ah...! 8) )
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7199
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 8 guests

-->