Any Imacros Command/Script To Retrieve Firefox Profile Name
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Any Imacros Command/Script To Retrieve Firefox Profile Name
Hi,
Anyone know Imacros command or script which able to retrieve current running firefox profile name.Thanks.
Anyone know Imacros command or script which able to retrieve current running firefox profile name.Thanks.
Re: Any Imacros Command/Script To Retrieve Firefox Profile
CIM...! (Read my Sig...)ysl78 wrote:Hi,
Anyone know Imacros command or script which able to retrieve current running firefox profile name.Thanks.
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}}_
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 9:39 pm, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Any Imacros Command/Script To Retrieve Firefox Profile
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...!
Duplicate Thread:
- Extract Number From Firefox Profiles Name Directory Path
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...! )
Duplicate Thread:
- Extract Number From Firefox Profiles Name Directory Path
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...ysl78 wrote:I am using function below to extract number from Firefox profiles name directory path:
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?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; }
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...! )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Any Imacros Command/Script To Retrieve Firefox Profile
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...
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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: Any Imacros Command/Script To Retrieve Firefox Profile
And some other Update, now 6 months later...
(Pity @OP in this Thread never followed up on their Thread (=> Spanking deserved...! ), except opening a Duplicate 3 weeks later (=> Double Spanking deserved...! ), which like expected got deleted by the Forum Admin , tja...! )
But OK, I was saying...:
- Fiddler + imacros multi-threading
(The Thread is just "starting" [2018-07-05], but it will probably be/become "Interesting", I think, ah-ah...! )
(Pity @OP in this Thread never followed up on their Thread (=> Spanking deserved...! ), except opening a Duplicate 3 weeks later (=> Double Spanking deserved...! ), which like expected got deleted by the Forum Admin , tja...! )
But OK, I was saying...:
=> Here is some new/current Thread with a possible Use/Need for identifying the current FF-Profile...: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...
- Fiddler + imacros multi-threading
(The Thread is just "starting" [2018-07-05], but it will probably be/become "Interesting", I think, ah-ah...! )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
-
- Posts: 3
- Joined: Mon Jan 14, 2019 9:51 am
- Contact:
Re: Any Imacros Command/Script To Retrieve Firefox Profile Name
I found the best method to get name of current profile. Using some script from about:profiles page. It's long, but very fast.
Code: Select all
function getCurrentProfile() {
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(
this,
"ProfileService",
"@mozilla.org/toolkit/profile-service;1",
"nsIToolkitProfileService"
);
const bundle = Services.strings.createBundle(
"chrome://global/locale/aboutProfiles.properties");
function findCurrentProfile() {
let cpd;
try {
cpd = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
} catch (e) {}
if (cpd) {
let itr = ProfileService.profiles;
while (itr.hasMoreElements()) {
let profile = itr.getNext().QueryInterface(Ci.nsIToolkitProfile);
if (profile.rootDir.path == cpd.path) {
return profile;
}
}
}
try {
return ProfileService.selectedProfile;
} catch (e) {
return null;
}
}
function display(profileData) {
let nameStr = bundle.formatStringFromName("name", [profileData.profile.name], 1);
if (profileData.isCurrentProfile) {
let currentProfileStr = bundle.GetStringFromName("currentProfile");
return nameStr;
}
}
let defaultProfile;
try {
defaultProfile = ProfileService.defaultProfile;
} catch (e) {}
let currentProfile = findCurrentProfile() || defaultProfile;
let iter = ProfileService.profiles;
while (iter.hasMoreElements()) {
let profile = iter.getNext().QueryInterface(Ci.nsIToolkitProfile);
let cprofile = display({ profile, isDefault: profile == defaultProfile, isCurrentProfile: profile == currentProfile });
if (cprofile!=undefined) return cprofile;
}
}
currentProfile = getCurrentProfile();
iimDisplay(currentProfile );
truongbuidp@gmail.com From VN
Re: Any Imacros Command/Script To Retrieve Firefox Profile Name
Main "Purpose" of my Post is to quote this User (Vietnamese IP), starting to "act" a bit strange...truongfiu-vn wrote: ↑Mon Jul 01, 2019 6:48 amI found the best method to get name of current profile. Using some script from about:profiles page. It's long, but very fast.Code: Select all
function getCurrentProfile() { "use strict"; const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyServiceGetter( this, "ProfileService", "@mozilla.org/toolkit/profile-service;1", "nsIToolkitProfileService" ); const bundle = Services.strings.createBundle( "chrome://global/locale/aboutProfiles.properties"); function findCurrentProfile() { let cpd; try { cpd = Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIProperties) .get("ProfD", Ci.nsIFile); } catch (e) {} if (cpd) { let itr = ProfileService.profiles; while (itr.hasMoreElements()) { let profile = itr.getNext().QueryInterface(Ci.nsIToolkitProfile); if (profile.rootDir.path == cpd.path) { return profile; } } } try { return ProfileService.selectedProfile; } catch (e) { return null; } } function display(profileData) { let nameStr = bundle.formatStringFromName("name", [profileData.profile.name], 1); if (profileData.isCurrentProfile) { let currentProfileStr = bundle.GetStringFromName("currentProfile"); return nameStr; } } let defaultProfile; try { defaultProfile = ProfileService.defaultProfile; } catch (e) {} let currentProfile = findCurrentProfile() || defaultProfile; let iter = ProfileService.profiles; while (iter.hasMoreElements()) { let profile = iter.getNext().QueryInterface(Ci.nsIToolkitProfile); let cprofile = display({ profile, isDefault: profile == defaultProfile, isCurrentProfile: profile == currentProfile }); if (cprofile!=undefined) return cprofile; } } currentProfile = getCurrentProfile(); iimDisplay(currentProfile );
(Only User with a Vietnamese IP I think, that I granted Access to the Forum since Jan 2018... (=> 99.9% Spammers... ))
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- thecoder2012
- Posts: 446
- Joined: Sat Aug 15, 2015 5:14 pm
- Location: Internet
- Contact:
Re: Any Imacros Command/Script To Retrieve Firefox Profile Name
Profiles? Useless in my eyes. I love my privacy. I have no profile (except default) or disk cache (too slow with NVMe SSD).
Not longer. Errormessage "The requested topic does not exist.".chivracq wrote: ↑Wed Feb 21, 2018 8:25 pmDuplicate Thread:
- Extract Number From Firefox Profiles Name Directory Path
I'm unsure but new background window is faster with imacros and js. See my other post.truongfiu-vn wrote: ↑Mon Jul 01, 2019 6:48 amI found the best method to get name of current profile. Using some script from about:profiles page. It's long, but very fast.
I'm unsure. I have no profiles but I can create a new profile under 'about:profiles'. Okay 'about:cache' is not better in my browser (pale moon 28.6.0, 64-bit):
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
Re: Any Imacros Command/Script To Retrieve Firefox Profile Name
Hum..., taking "Advantage" of @OP checking the Forum right now to bump this Thread which was quite interesting...
Pity @OP (= @ysl78) never bothered to follow up, even though I asked them several times to do so...
Don't be "surprised" if me and other Advanced Users don't want to help you again, next time you'll open a Thread on the Forum..., tja...!
Pity @OP (= @ysl78) never bothered to follow up, even though I asked them several times to do so...
Don't be "surprised" if me and other Advanced Users don't want to help you again, next time you'll open a Thread on the Forum..., tja...!
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...