How to get desktop file path with JavaScript?

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
Post Reply
kEI
Posts: 7
Joined: Tue Dec 24, 2019 4:28 am
Location: JAPAN
Contact:

How to get desktop file path with JavaScript?

Post by kEI » Tue Mar 10, 2020 7:37 am

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
WINDOWS 7
Firefox ESR 52.9.0
I looked for a way to get the desktop file path, but couldn't find it.

The method of Node.js was found at the following site, is there a way to get it with normal js?
https://stackoverflow.com/questions/908 ... nostic-way

I can do this by changing the file path in the code to desktop.
However, since the path differs depending on the environment, it seems that there is only a way to get the path with JavaScript.

I want to be independent of any environment.

Thank you
Last edited by kEI on Tue Mar 10, 2020 11:50 am, edited 1 time in total.
  • I have a blog for iMacros for beginners. (only Japanese)
  • https://teilab.net/category/imacros/
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to get desktop file path with JavaScript

Post by chivracq » Tue Mar 10, 2020 9:59 am

kEI wrote:
Tue Mar 10, 2020 7:37 am

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
WINDOWS 7
Firefox ESR 52.9.0
I looked for a way to get the desktop file path, but couldn't find it.

The method of Node.js was found at the following site, is there a way to get it with normal js?
https://stackoverflow.com/questions/908 ... nostic-way

I can do this by changing the file path in the code to desktop.
However, since the path differs depending on the environment, it seems that there is only a way to get the path with JavaScript.

I want to be independent of any environment.

Thank you

Can you add a Question Mark to your Thread Title...? (You are not sharing a 'How-To'...)

>>>

Hum, I "suspect" your Qt is actually an "X/Y Pb" and you are not asking the "right" Qt because you already have some probably cumbersome Implementation in mind..., but you might want to explain/give more Details why you need the Desktop Path and what you want to do with it... :idea:

>>>

If you installed iMacros and all iMacros Folders to the Default Location, you could use the '!FOLDER_DATASOURCE' Var from which you can deduct/"reconstruct" the Desktop Path... :idea:

Same Principle also, from Info in 'about:profiles' or 'about:cache'. :idea:

And have a look at those 2 Threads on the Forum, with ways also to call your 'Node.js' Function...: :idea:
- Any Imacros Command/Script To Retrieve Firefox Profile Name
- Find full path with subfolder of macros
- (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...
kEI
Posts: 7
Joined: Tue Dec 24, 2019 4:28 am
Location: JAPAN
Contact:

Re: How to get desktop file path with JavaScript

Post by kEI » Tue Mar 10, 2020 11:48 am

Can you add a Question Mark to your Thread Title...? (You are not sharing a 'How-To'...)
I added a question mark.
If you installed iMacros and all iMacros Folders to the Default Location, you could use the '!FOLDER_DATASOURCE' Var from which you can deduct/"reconstruct" the Desktop Path... :idea:
I don't seem to need to get the desktop file path using 「! FOLDER_DATASOURCE」

thank you !!!
  • I have a blog for iMacros for beginners. (only Japanese)
  • https://teilab.net/category/imacros/
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to get desktop file path with JavaScript?

Post by chivracq » Tue Mar 10, 2020 12:17 pm

kEI wrote:
Tue Mar 10, 2020 11:48 am
Can you add a Question Mark to your Thread Title...? (You are not sharing a 'How-To'...)
I added a question mark.

Alright, Thanks for that... But notice that when you are quoting, your Post automatically takes the Title of the (first) Post you are quoting, so your 2nd Post has already lost the Qt Mark again... You need to use the 'Post Reply' Button to automatically inherit the Thread Title and you can then still quote from inside that Post, or if you used the 'Quote' Button, you then need to edit the Title again...

>>>
kEI wrote:
Tue Mar 10, 2020 11:48 am
If you installed iMacros and all iMacros Folders to the Default Location, you could use the '!FOLDER_DATASOURCE' Var from which you can deduct/"reconstruct" the Desktop Path... :idea:
I don't seem to need to get the desktop file path using 「! FOLDER_DATASOURCE」

thank you !!!

Oh...!, alright, so simply using '!FOLDER_DATASOURCE' is the "Solution" to your Scenario and the Functionality that you actually want, so I was right about the "X/Y Problem" Feeling, ah-ah...! :wink:

And from that '!FOLDER_DATASOURCE' Path, you can also easily deduct/reconstruct all Paths for all iMacros Folders (=> 'Downloads' / 'Macros' / etc...) if you need any to reuse for 'SAVEAS' or 'FILEDELETE' for example... 8)
- (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...
kEI
Posts: 7
Joined: Tue Dec 24, 2019 4:28 am
Location: JAPAN
Contact:

Re: How to get desktop file path with JavaScript?

Post by kEI » Wed Mar 11, 2020 5:05 am

chivracq wrote:
Tue Mar 10, 2020 12:17 pm
Alright, Thanks for that... But notice that when you are quoting, your Post automatically takes the Title of the (first) Post you are quoting, so your 2nd Post has already lost the Qt Mark again... You need to use the 'Post Reply' Button to automatically inherit the Thread Title and you can then still quote from inside that Post, or if you used the 'Quote' Button, you then need to edit the Title again...
I used 'Post Replay' button and I made it look the same as you.
Is it correct?


chivracq wrote:
Tue Mar 10, 2020 12:17 pm
Oh...!, alright, so simply using '!FOLDER_DATASOURCE' is the "Solution" to your Scenario and the Functionality that you actually want, so I was right about the "X/Y Problem" Feeling, ah-ah...! :wink:

And from that '!FOLDER_DATASOURCE' Path, you can also easily deduct/reconstruct all Paths for all iMacros Folders (=> 'Downloads' / 'Macros' / etc...) if you need any to reuse for 'SAVEAS' or 'FILEDELETE' for example... 8)
Just now I solved what I wanted to do! !
Thank you as always.
  • I have a blog for iMacros for beginners. (only Japanese)
  • https://teilab.net/category/imacros/
Post Reply