Help with making a script

Discuss and share scripts and script files...
Post Reply
pleiades
Posts: 52
Joined: 13 Aug 2016 10:36

Help with making a script

Post by pleiades »

Ola!

I need help with making a script, the idea of the script is to make all files/folder open in XYplorer. This is for application that support links/shortcuts and don't support custom browser. The application will always open the files/folder in windows explorer.

The idea is.

1. move the selected file(s)/folder(s) to a specific folder (example selected files youtube videos webm, move to videos folder)
2.get the path of the file(s)/folder(s)
3. combine the path of the file(s)/folder(s) and the path of xyplorer executable ( c:\xyplorer\xyplorer.exe path of files/folder)
4. create a shortcut/ link to the clipboard to be pasted


The scripts command.

1. moveto (using built in dialog)
2. copy path of the files/folders
3. copytext "path"; copytext "<br><xypath>\<xyexe>", a; (append the xypath)
4. new(, "link"); //creates shortcut to currently selected item

How to combine these into a script?

TIA!

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Help with making a script

Post by highend »

Sorry but can you give a real world example with the execution of all steps because there are a few things that don't make much sense to me
1. move the selected file(s)/folder(s) to a specific folder (example selected files youtube videos webm, move to videos folder)
To which folder? Is that a fixed one?
1. moveto (using built in dialog)
Which inbuilt dialog when used from a script?
3. copytext "path"; copytext "<br><xypath>\<xyexe>", a; (append the xypath)
? Show how this should look like inside the clipboard
4. new(, "link"); //creates shortcut to currently selected item
The selected files were moved to a different folder. So which current selected item should this be?
One of my scripts helped you out? Please donate via Paypal

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Help with making a script

Post by bdeshi »

pleiades wrote:This is for application that support links/shortcuts and don't support custom browser. The application will always open the files/folder in windows explorer.
Sounds like you want another application to open file/folders in Xyplorer. That can't be accomplished from XY's side.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

pleiades
Posts: 52
Joined: 13 Aug 2016 10:36

Re: Help with making a script

Post by pleiades »

Thanks for the assistance sir highend!
To which folder? Is that a fixed one?
It can be fixed, I will just create multiple scripts for multiple folder locations
Which inbuilt dialog when used from a script?
the dialog I'm refering is the Shift + F7 shortcut dialog, I see that you can add locations there and it stays there. but the folder location can also be fixed so removing the need for this dialog.

? Show how this should look like inside the clipboard
This will show as
For files (I believe this will play in XYplorer association which is the intended outcome)

"C:\XYplorer\XYplorer.exe" "E:\Youtube-videos.webm"

For Folders ( This will open the videos folder)

"C:\XYplorer\XYplorer.exe" "F:\Videos"

The selected files were moved to a different folder. So which current selected item should this be?
The new location would be used, to be pasted on the 3rd-party application, so if you click on the 3rd-party application,
if its a file, then it will open XYplorer, go to the folder path and play the file.

if its a folder, it will open XYplorer and go to the folder path.


--------------

I like to add fixed tags/labels to this script

User set fixed location
1. User sets the folder location
2. User sets the tags/label


The user process goes

1. The user selects files/folders in XYplorer
2. The user then clicks on the automated script - wait for it to finish
3. The user would then paste the clipboard lnk/shortcut to the 3rd-party-app

This is the connection between XYplorer and other apps
3.a If the user clicked on the lnk/shortcut of the 3rd-party-app, it will open XYplorer plus the files/folders

Script process
1. The script will move the selected files/folder to new folder location
2. The script will then tag/label the files/folders, only the first folder no subfolders
3. After the tags/label, the script will then copy the path of the files/folders
4. Then add the XYplorer executable path to the files/folders path
5. Create a lnk/shortcut to the paths ("C:\XYplorer\XYplorer.exe" "Files/folder path")
6. Copy it to the clipboard

TIA!

pleiades
Posts: 52
Joined: 13 Aug 2016 10:36

Re: Help with making a script

Post by pleiades »

Sounds like you want another application to open file/folders in Xyplorer. That can't be accomplished from XY's side.
Thanks for the reply sir SammaySarkar,

The idea is to use lnk/shortcuts to connect XYplorer and 3rd-party-apps that supports lnk/shortcut.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Help with making a script

Post by highend »

Why should files / folders now be labelled / tagged?
And how (which tags / labels should be given)?

To step 3:

Code: Select all

    $dstFolders = <<<>>>
R:\destination1
R:\destination2
>>>;

    $selectedItems = get("SelectedItemsPathNames", <crlf>);
    $dstFolder = popupmenu($dstFolders, 6:=<crlf>);
    if (!$dstFolder || !$selectedItems) { status "No destination folder chosen / no items selected, aborted!", "8B4513", "stop"; end 1==1; }
    moveto $dstFolder, $selectedItems, , 2;
5. Where exactly should this lnk / shortcut now be created? With which name?
And while this is easy for a single folder, how should this be done if multiple files have been selected?
Because for multiple files you'd need a script to be executed when XYplorer is invoked that is able
to select all items...
One of my scripts helped you out? Please donate via Paypal

pleiades
Posts: 52
Joined: 13 Aug 2016 10:36

Re: Help with making a script

Post by pleiades »

Why should files / folders now be labelled / tagged?
And how (which tags / labels should be given)?
For the user to know which files/folders is already added to the 3rd party application.
5. Where exactly should this lnk / shortcut now be created? With which name?
And while this is easy for a single folder, how should this be done if multiple files have been selected?
Because for multiple files you'd need a script to be executed when XYplorer is invoked that is able
to select all items...
Single file/folder is okay, i thought it was possible.

Post Reply