URL Macros {:server} {:dir} {:filename}

Author Message
09/19/2004 03:50 pm
Can someone tell me exactly how the undocumented URL Macros {:server} {:dir} {:filename} work (some examples)?

I tried different things that didn`t work.

TIA
Oleg Chernavin 09/20/2004 08:18 am
These macros are designed for URL Filters keywords mostly. They are good for creating universal templates. For example, you will be able to specify the {:server} as a keyword there, which means the starting server. The same is with the other keywords.

Best regards,
Oleg Chernavin
MP Staff
09/20/2004 12:30 pm
> These macros are designed for URL Filters keywords mostly.

Thank you, but this is what I already tried to do. But I didn`t have much luck with my results. Assuming
http://www.server.com/directory1/directory2/directory3/file.htm
would be the start URL.

What part represents {:server}; {:dir}; {:filename} ?

OK, {:filename} should be: file.htm

{:server} = www.server.com or http://www.server.com/ or http://www.server.com or...?

{:dir} = http://www.server.com/directory1/directory2/directory3/
or
http://www.server.com/directory1/directory2/directory3
or
/directory3/
or
directory3
or
.
.
?

I`m really confused.

Well, I will tell you what I tried in order to download the following file:
http://tigger.smu.edu.sg/software/gimp/gimp-2.0.0-i586-setup.zip

URL: http://tigger.smu.edu.sg/software/gimp/
Text and Archive File Filters checked.
Included files keywords in Filename URL Filters:

http://tigger.smu.edu.sg/{:dir}/gimp/gimp-2.0.0-i586-setup.zip
http://tigger.smu.edu.sg/{:dir}/gimp-2.0.0-i586-setup.zip
{:dir}/gimp/gimp-2.0.0-i586-setup.zip
{:dir}/gimp-2.0.0-i586-setup.zip

http://tigger.smu.edu.sg{:dir}/gimp/gimp-2.0.0-i586-setup.zip
http://tigger.smu.edu.sg{:dir}/gimp-2.0.0-i586-setup.zip

http://tigger.smu.edu.sg{:dir}gimp/gimp-2.0.0-i586-setup.zip
http://tigger.smu.edu.sg{:dir}gimp-2.0.0-i586-setup.zip
{:dir}gimp/gimp-2.0.0-i586-setup.zip
{:dir}gimp-2.0.0-i586-setup.zip

http://{:server}/software/gimp-2.0.0-i586-setup.zip
http://{:server}software/gimp-2.0.0-i586-setup.zip

{:server}/software/gimp-2.0.0-i586-setup.zip
{:server}software/gimp-2.0.0-i586-setup.zip
_______

I have checked all above keywords: The project doesn`t download "gimp-2.0.0-i586-setup.zip".

The download works ok when I check the keyword:
http://tigger.smu.edu.sg/software/gimp/gimp-2.0.0-i586-setup.zip

What have I made wrong?

And can you please tell me a "real-life" example for what the Macro {:filename} could be good for?
(URL and File Filter)
Maybe I haven`t understood something essentially,...

But I have another suggestion for URL Macros:

URL: http://www.server.com/directory1/directory2/directory3/file.htm

{:dir1} = directory1
{:dir2} = directory2
{:dir3} = directory3
.
.
{:dir10}

{:dir1} should represent only the directory name (without slashes).
I think that 10 directory levels should be enough.

Could that be done?

Thanks for your answer.
09/21/2004 06:19 am
I took once more a look in my filters and saw that I made a mistake in the keywords that included the {:server} macro. I was irritated by the double "gimp" ... (directory and filename: gimp/gimp-2.0.0-i586-setup.zip)

I forgot to insert /gimp/ in the {:server} keywords:

Now this is ok (as I supposed):
http://{:server}/software/gimp/gimp-2.0.0-i586-setup.zip

That is what I was awaiting:

http://tigger.smu.edu.sg/software/gimp/gimp-2.0.0-i586-setup.zip

I assumed, that this should represent the keywords:
tigger.smu.edu.sg = {:server}
/software/gimp/ = {:dir}
gimp-2.0.0-i586-setup.zip = {:filename}

I checked all the included keywords at once: nothing was downloaded.
Now I checked one after the other. That had a different effect: the download starts when some keywords were checked, but why? They are all in the included list. What`s the reason for this behavior?

But I can`t find out, how the {:dir} macro works:

By checking these keywords (one after the other), all zip files in the directory were downloaded (and not only gimp-2.0.0-i586-setup.zip):
http://{:server}{:dir}gimp-2.0.0-i586-setup.zip
http://tigger.smu.edu.sg{:dir}gimp-2.0.0-i586-setup.zip

By checking this keyword, the project did not download anything:
http://tigger.smu.edu.sg/{:dir}/gimp-2.0.0-i586-setup.zip

Thanks for reading.
Oleg Chernavin 09/21/2004 09:45 am
I just fixed that. You are correct when you described what these keywords mean.

Here is the fixed version:

http://www.metaproducts.com/download/betas/oep1800.zip

Oleg.
09/22/2004 03:06 am
> I just fixed that.

Thank you that fixing bugs has such a high priority!

> You are correct when you described what these keywords mean.

OK, this works just like I had imagined; I already had my doubts...

And I figured out how {:filename} could be used for:
Assuming the starting URL would be:
http://www.server.com/directory1/directory2/

... you could add an additional URL:
http://www.server.com/directory1/directory2/variable
(The server could respond: File not found, but that doesn`t matter.)

Although I would prefer that it would be possible do declare variables separately (Variables=var1=xxx; var2=yyy;var3=zzz -> and use {:var1} ; {:var2}; {:var3} in the Project. What do you think about it?) you have a variable {:filename} that you could use at any place.

> Here is the fixed version:
>
> http://www.metaproducts.com/download/betas/oep1800.zip

Thank you! Works fine. :-)

p.s.: What do you think about my first suggestion? I don`t have an urgent need for this, but maybe it`s worth to think about it?

| But I have another suggestion for URL Macros:
|
| URL: http://www.server.com/directory1/directory2/directory3/file.htm
|
| {:dir1} = directory1
| {:dir2} = directory2
| {:dir3} = directory3
| .
| .
| {:dir10}
|
| {:dir1} should represent only the directory name (without slashes).
I think that 10 directory levels should be enough.
(Perhaps {:DirName1}; ... would be clearer (directory names without slashes))

Thank you!
09/22/2004 06:51 am
> Thank you! Works fine. :-)

Pleased too early...
I think that there is still a bug when you use the {:filename} URL Macro:

To be safe, I deleted the zip extension from the Archive File Filter and checked Other File Filter instead. I have put {:filename} in the included files keywords list.

I tested this URL with Level 1:
http://tigger.smu.edu.sg/software/gimp/

The directory contains 2 zip files:
http://tigger.smu.edu.sg/software/gimp/gtk+-2.2.4-20040124-setup.zip
http://tigger.smu.edu.sg/software/gimp/gimp-2.0.0-i586-setup.zip

The results:

URL:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*.zip
(OK, loads all zip files)

URL:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*mm*.*
(OK, doesn`t load any files without "mm")

URL:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*m*.*
(OK, downloads only the desired file)

And her is the buggy setting:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/g*.*
(It doesn`t download the desired files!)

Another buggy setting:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/g*m*.zip

It seems like a simple letter at the start causes this bug... ?
Oleg Chernavin 09/23/2004 09:00 am
I think, you are wrong - it doesn`t make sense to place such URLs:

http://tigger.smu.edu.sg/software/gimp/*.zip

This URL is invalid and cannot be loaded. It will not affect URL Filters keywords either. In fact, only the first URL is being used to extract {:dir}, {:filename} and {:server} keywords.

Oleg.
09/23/2004 11:14 am
> I think, you are wrong

Sorry, but I think that I`m not wrong. How do you think, that I could get my results? Make the test by yourself. It`s a really easy setting, as I already described above (don`t forget to put {:filename} in the included file filters keywords).

> - it doesn`t make sense to place such URLs:
> http://tigger.smu.edu.sg/software/gimp/*.zip

In general: Yes. I know that the {:filename} macro wasn`t designed to use it for such settings.

But I saw it as a "trick" to get a user defined variable (I already described it in my other message). And that`s why I was asking for this implementation:

| Although I would prefer that it would be possible do declare variables separately
| (Variables=var1=xxx; var2=yyy;var3=zzz -> and use {:var1} ; {:var2}; {:var3} in the Project.
| What do you think about it?) you have a variable {:filename} that you could use at any place.

I don`t know why you haven`t said anything about my two suggestions that I mentioned in my above messages? Sorry, I don`t want to push..; I only would like to know what you think about them; not more.

> This URL is invalid and cannot be loaded.

Right, as I said before:

| |... you could add an additional URL:
| http://www.server.com/directory1/directory2/variable
| (The server could respond: File not found, but that doesn`t matter.)

> It will not affect URL Filters keywords either. In fact, only the first URL is being used
> to extract {:dir}, {:filename} and {:server} keywords.

If that`s the way it should be, then there is a bug in OEP; beside the bug that I already described.

I have tested once more some settings:

The same as above:
To be safe, I deleted the zip extension from the Archive File Filter and checked Other File Filter instead. I have put {:filename} in the included files keywords list.

I tested this URL with Level 1:
http://tigger.smu.edu.sg/software/gimp/

The directory contains 2 zip files:
http://tigger.smu.edu.sg/software/gimp/gtk+-2.2.4-20040124-setup.zip
http://tigger.smu.edu.sg/software/gimp/gimp-2.0.0-i586-setup.zip


URLs: (Put all of them in the URLs field):
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*i*.zip
http://tigger.smu.edu.sg/software/gimp/*mm*.zip
Result:
-> gimp-2.0.0-i586-setup.zip is downloaded

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*mm*.zip
http://tigger.smu.edu.sg/software/gimp/*i*.zip
-> gimp-2.0.0-i586-setup.zip

Compare the two results: Strange, that shouldn`t be -> bug
The same with "*k*.zip":

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*k*.zip
http://tigger.smu.edu.sg/software/gimp/*mm*.zip
-> gtk+-2.2.4-20040124-setup.zip

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*mm*.zip
http://tigger.smu.edu.sg/software/gimp/*k*.zip
-> gtk+-2.2.4-20040124-setup.zip


Another setting:

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*i*.zip
http://tigger.smu.edu.sg/software/gimp/*k*.zip
-> gimp-2.0.0-i586-setup.zip

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*k*.zip
http://tigger.smu.edu.sg/software/gimp/*i*.zip
-> gimp-2.0.0-i586-setup.zip

???
This is surely a bug!

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*k*.zip
http://tigger.smu.edu.sg/software/gimp/*k*.zip
-> gtk+-2.2.4-20040124-setup.zip

URLs:
http://tigger.smu.edu.sg/software/gimp/*mm*.zip
http://tigger.smu.edu.sg/software/gimp/*i*.zip
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*k*.zip
-> gimp-2.0.0-i586-setup.zip

??? -> bug!

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/g*.zip
No zip file is downloaded -> bug

URLs:
http://
Oleg Chernavin 09/23/2004 11:42 am
This function takes the first URL and works only with it. For a quick workaround, exchange the URLs, like:

http://tigger.smu.edu.sg/software/gimp/g*.zip
http://tigger.smu.edu.sg/software/gimp/

Oleg.
09/23/2004 12:36 pm
Thanks for your fast answer!

> For a quick workaround, exchange the URLs, like:
>
> http://tigger.smu.edu.sg/software/gimp/g*.zip
> http://tigger.smu.edu.sg/software/gimp/

This works ok for you?

As I already mentioned twice, this is a "special" bug:

| And her is the buggy setting:
| http://tigger.smu.edu.sg/software/gimp/
| http://tigger.smu.edu.sg/software/gimp/g*.*
| (It doesn`t download the desired files!)
|
| Another buggy setting:
| http://tigger.smu.edu.sg/software/gimp/
| http://tigger.smu.edu.sg/software/gimp/g*m*.zip and:
|
| ***It seems like a simple letter at the start causes this bug... ?***

and

| URLs:
| http://tigger.smu.edu.sg/software/gimp/
| http://tigger.smu.edu.sg/software/gimp/g*.zip
| No zip file is downloaded -> bug
|
| URLs:
| http://tigger.smu.edu.sg/software/gimp/g*.zip
| http://tigger.smu.edu.sg/software/gimp/
| No zip file is downloaded -> bug

> For a quick workaround, exchange the URLs, like:

In this case the order doesn`t matter!

Settings that work ok:

http://tigger.smu.edu.sg/software/gimp/*m*.*
http://tigger.smu.edu.sg/software/gimp/

and

| http://tigger.smu.edu.sg/software/gimp/
| http://tigger.smu.edu.sg/software/gimp/*m*.*

So this isn`t really a workaround for the mentioned bugs...

Thank you!
09/23/2004 01:51 pm
I get also strange results when I use {:filename} in URL Substitutes (not yet supported?):

URL:
http://www.mozilla.org/images/product-front-thunderbird.png

URL Substitute:

URL
product-front-thunderbird.png

Replace
product-front-thunderbird.png

With
{:filename}

The result:
product-front-thunderbird.png -> default.htm

or

URL
product-front-thunderbird.png

Replace
product-front-thunderbird.png

With
{:filename}abc

The result:
product-front-thunderbird.png -> abcabc
Oleg Chernavin 09/24/2004 11:56 am
Yes, I will work on adding the full support of enumerating macros for URL Substitutes later.

Regarding URL Filters - I just finally did this. It worked well on my computer. Please try the following update:

http://www.metaproducts.com/download/betas/oep1803.zip

Oleg.
09/24/2004 01:05 pm
> Yes, I will work on adding the full support of enumerating macros for URL Substitutes later.

OK, thanks for the information. I only used the {:filename} macro in URL Substitutes for another test (to see what it represents).

> Regarding URL Filters - I just finally did this. It worked well on my computer.

Yes, the mentioned bugs are fixed! :-)

It seems like the {:filename} macro represents now *all* filenames in every URL line (at least when it is used in URL Filters:)

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*aaa*.zip
http://tigger.smu.edu.sg/software/gimp/*bbb*.zip
http://tigger.smu.edu.sg/software/gimp/*k*.zip
http://tigger.smu.edu.sg/software/gimp/*ccc*.zip
Result:
It finds the only matching keyword *k*.*:
-> gtk+-2.2.4-20040124-setup.zip is downloaded

URLs:
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*aaa*.zip
http://tigger.smu.edu.sg/software/gimp/*bbb*.zip
http://tigger.smu.edu.sg/software/gimp/*k*.zip
http://tigger.smu.edu.sg/software/gimp/*ccc*.zip
http://tigger.smu.edu.sg/software/gimp/*ddd*.zip
http://tigger.smu.edu.sg/software/gimp/*i*.zip
http://tigger.smu.edu.sg/software/gimp/*eee*.zip
Result:
It finds both matching keywords: *k*.* and *i*.*:
-> gtk+-2.2.4-20040124-setup.zip and gimp-2.0.0-i586-setup.zip are downloaded

URLs:
http://tigger.smu.edu.sg/software/gimp/*aaa*.zip
http://tigger.smu.edu.sg/software/gimp/*bbb*.zip
http://tigger.smu.edu.sg/software/gimp/*i*.zip
http://tigger.smu.edu.sg/software/gimp/*ccc*.zip
http://tigger.smu.edu.sg/software/gimp/
http://tigger.smu.edu.sg/software/gimp/*ddd*.zip
http://tigger.smu.edu.sg/software/gimp/*eee*.zip
http://tigger.smu.edu.sg/software/gimp/*fff*.zip
Result:
It finds the only matching keyword *i*.*:
-> gimp-2.0.0-i586-setup.zip is downloaded


This is a consistent logic; fine. Good work!

Thank you!
Oleg Chernavin 09/24/2004 01:11 pm
Yes, this macro should represent all URLs listed in the Project.

Oleg.
09/24/2004 01:53 pm
> Yes, this macro should represent all URLs listed in the Project.

Thanks for the confirmation. -> You changed the logic:

| In fact, only the first URL is being used to extract {:dir}, {:filename} and {:server} keywords.

But which filename does it represent when it is used in other places (where only the use of 1 separate filename does make sense)?

I suppose that it represents the filename of the first URL? Right?
Oleg Chernavin 09/24/2004 04:47 pm
Frankly, I doubt that URL Substitutes will work with these {:filename} macros now. Prehaps, it will be simply replaced with an empty symbol. I haven`t check this, anyway.

Oleg.
09/25/2004 04:28 am
> Frankly, I doubt that URL Substitutes will work with these {:filename} macros now.

OK, this is consistent. The {:filename} macro represents always all filenames from all starting URLs (and this isn`t useful for URL Substitutes).

> Prehaps, it will be simply replaced with an empty symbol.

OK, this should avoid getting strange results.

In sum: my "trick" to get a user defined variable won`t work at all places.

-> The more I wish that I could use separate user defined variables (which could be also used in URL Substitutes) like I described before:

| Although I would prefer that it would be possible do declare variables separately
| (Variables=var1=xxx; var2=yyy;var3=zzz -> and use {:var1} ; {:var2}; {:var3} in the Project.
| What do you think about it?) you have a variable {:filename} that you could use at any place.

Thank you!
Oleg Chernavin 09/27/2004 01:51 am
Well, this looks more like a programming language. I am not sure about this yet. How would you use that?

Oleg.
09/27/2004 01:06 pm
> Well, this looks more like a programming language

I don`t think that this has really a lot of a programming language. In fact, this is supposed to be only an assistance in order to avoid too much typing work. The operation purpose of such a variable can be versatile. I want to name only a few things, for what one could use these variables (mostly in templates):

- I would see this first of all as central administration of certain keywords which would be needed repeatedly at other places.

- For example, one could set a very certain Session-ID - or parts from that - (a Session-ID, that would be normally changed during the download -process), that one could place in URL Filters or in URL Substitutes.

- Also in URL Substitutes I would see an operation purpose in order to rename certain files or directories according to your own wishes. If these (changing) names occure now in several replacements, you could avoid a lot of typing work.

- The variables could represent for example also parts of a post-command that you want to use for the renaming of a file or a directory (or to use it in URL Filters).

- You could use variables in URL Substitutes to save certain notes by renaming filenames or directories.

... and so on

In total I see diverse operation purposes. I`m sure that there are also still reasonable areas of which I did currently not think of. I regard user-defined variables as a generally useful tool which could be used widely.

Perhaps my examples aren`t very good, but I`m sure that you could also find some areas in which variables are really useful. And maybe it`s worth to think of an implementation in the future...

Thank you!
Oleg Chernavin 09/28/2004 06:28 am
OK. Thank you. I will place it to my plans.

Oleg.
09/28/2004 10:31 am
Thank you very much, for adding this feature integration to your plans!
Oleg Chernavin 09/28/2004 01:22 pm
You are welcome! I haven`t placed it in the priority list. However if you will need this urgently, please let me know.

Oleg.
09/28/2004 03:29 pm
> I haven`t placed it in the priority list.

That`s ok. I fully understand that this feature hasn`t got a high priority.

> However if you will need this urgently, please let me know.

Thank you! But, no: it isn`t urgent! And I`m fully satisfied with the recording in your plans.

Thanks again!
Oleg Chernavin 09/29/2004 06:54 am
Good.

Oleg.
10/02/2004 01:46 pm
> Frankly, I doubt that URL Substitutes will work with these {:filename} macros now.
> Prehaps, it will be simply replaced with an empty symbol.

Maybe this should be fixed in the next Release. I started a project - rather by chance - that still contained the {:filename} macro in URL Substitutes. This ended up with an "Access violation". Perhaps some people don`t recognize that the macros {:filename}, {:dir} and {:server} are responsible for these error-messages?
Oleg Chernavin 10/02/2004 03:21 pm
Thank you! I will try to fix it this Monday.

Can you tell me, if the error occured immediately when you started the download or after some files were loaded?

Oleg.
10/02/2004 05:02 pm
> Thank you! I will try to fix it this Monday.

Thank you, but I don`t think that it is sooo urgent. I also rather meant an adjustment in the next official final version (not beta).

If I`m not wrong, there isn`t yet an entry in the Help file regarding these macros. Therefore only a few people will attempt to use these macros (at unfitting places). Maybe you should add an entry that describes these macros (and where they can (not) be used) in the Help file of the next final version.

> Can you tell me, if the error occured immediately when you started the download
> or after some files were loaded?

Immediately!
Oleg Chernavin 10/05/2004 02:21 am
OK. This is fixed. I also added the description of these macros to the Help file.

Thank you!

Oleg.