Hi,
I have a small script that I want to use to copy a png file into the clipboard.
Which I want to go like this.
In this case I want to put the compiled script in the same directory where the png file is, hoping that it would be able to find the file. Unfortunately that is not the case.
If I give the thing a hard name like in the next example it will work.
But this is not what I want as I want to be able to distribute the script in my application, so putting the compiled script next to the png file is the most secure way to distribute.
Anyone knows how the apple script can figure out the file name from the directory from which it is executed ??
Thank in advance,
@+Maarten,
I have a small script that I want to use to copy a png file into the clipboard.
Which I want to go like this.
Code:
set pngData to read file "copytoclipboard.png" as «class PNGf»
set the clipboard to pngData
In this case I want to put the compiled script in the same directory where the png file is, hoping that it would be able to find the file. Unfortunately that is not the case.
If I give the thing a hard name like in the next example it will work.
Code:
set pngData to read file "Users:myshout:Library:myapplication:copytoclipboard.png" as «class PNGf»
set the clipboard to pngData
But this is not what I want as I want to be able to distribute the script in my application, so putting the compiled script next to the png file is the most secure way to distribute.
Anyone knows how the apple script can figure out the file name from the directory from which it is executed ??
Thank in advance,
@+Maarten,
Last edited by a moderator: