Sign in to follow this  
Followers 0
pase

FileFindFirstFile

5 posts in this topic

Hello,

I often tried to write scripts with relative paths. For example with the @ScriptDir Macro to convert all jpg pictures in the script's folder to thumbnails:

$search = FileFindFirstFile('"' & @ScriptDir & '\*.jpg' & '"')

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1  ; create Thumbnails
    $file = FileFindNextFile($search)
    If @error Then ExitLoop 
    $i = $i + 1
    RunWait("C:\Programs\make_thumb.exe " & $file, "", )
WEnd

FileClose($search)oÝ÷ Ù8^IÊâ¦Ö¥Á¬¬µêæv­zÌ"¶axǬ±¨ªê-6âë?v*ÞrÚ+ë&j×!yÛazÇ­ÈijÛ^®z®¢Ö¥¶.az·­ç^~)âµérW¬{aÇè׫N¨¶«Á¬®§v'Èr§ëayø«²Ùbëhjv²nµêZ¶azÇ+p¢¹,){^r×z®¶­sbb33c·6V&6ÒfÆTfæDf'7DfÆR3¢b3#´fÆW2b3#²¢æ§r

Of course it would be better, if the script would work with relative paths...

I'm sure that there is only a small change necessary, but I have no idea... :)

Any help would be appreciated!

Greets pase :)

Share this post


Link to post
Share on other sites



just this should work:

$search = FileFindFirstFile(@ScriptDir & '\*.jpg' )

as long is the script is running from that folder.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

That is really amazing, I got a reply, which solves my problem, within two minutes :)

Thank you very much!

Greets pase :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

That is really amazing, I got a reply, which solves my problem, within two minutes :)

mmmm not sure how to interpret that line and I should take that personal .. (j/k) :)

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0